filterNumeric {iNZightTools} | R Documentation |
Filter a dataframe by some boolean condition of one numeric variable and returns the result along with tidyverse code used to generate it.
filterNumeric(.data, var, op, num)
.data |
a dataframe or survey design object to filter |
var |
character of the column in |
op |
a logical operator of "<=", "<", ">=", ">", "==" or "!=" for the boolean condition |
num |
a number for which the |
filtered dataframe with tidyverse code attached
Owen Jin, Tom Elliott
filtered <- filterNumeric(iris, var = "Sepal.Length", op = "<=", num = 5)
cat(code(filtered))
head(filtered)
require(survey)
data(api)
svy <- svydesign(~dnum+snum, weights = ~pw, fpc = ~fpc1+fpc2, data = apiclus2)
(svy_filtered <- filterNumeric(svy, var = "api00", op = "<", num = 700))
cat(code(svy_filtered))