Description Usage Arguments Value See Also Examples
Subset a data source by rows
1 2 3 4 5 |
.data |
A data source. |
... |
Expressions to filter by. |
.outFile |
Output format for the returned data. If not supplied, create an xdf tbl; if |
.rxArgs |
A list of RevoScaleR arguments. See |
An object representing the filtered data. This depends on the .outFile
argument: if missing, it will be an xdf tbl object; if NULL
, a data frame; and if a filename, an Xdf data source referencing a file saved to that location.
filter
in package dplyr, subset
1 2 3 4 5 6 7 8 9 10 11 12 | mtx <- as_xdf(mtcars, overwrite=TRUE)
tbl <- filter(mtx, mpg > 20)
nrow(tbl)
tbl2 <- filter(mtx, am == 1, vs == 1)
nrow(tbl2)
# filter on rows and columns simultaneously with .rxArgs
tbl3 <- filter(mtx, am == 1, vs == 1, .rxArgs=list(varsToKeep=c("mpg", "cyl")))
dim(tbl3)
# save to a persistent Xdf file
filter(mtx, am == 1, vs == 1, .outFile="mtcars_filter.xdf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.