Description Usage Arguments Value Examples
Filter rows via integer/numeric position or logical vector
1 | filter_data(.data, ...)
|
.data |
Data frame or two dimensional array |
... |
Each argument/expression should should evaluate and reduce down to
an integer (row number) or logical vector. The filter will keep all row
numbers that appear in all evaluated expressions (commas are the equivalent
to |
Sliced/filtered data frame
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(12)
d <- data.frame(
mpg = rnorm(100, 25, 3),
gear = sample(3:6, 100, replace = TRUE),
vs = sample(0:1, 100, replace = TRUE),
stringsAsFactors = FALSE
)
filter_data(d, mpg > 30)
filter_data(d, !mpg < 30)
filter_data(d, mpg > 30, !mpg < 30)
filter_data(d, mpg > 30, gear == 4)
filter_data(d, mpg > 30 | gear == 4, vs == 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.