Select multiple columns
Usage
selectIf(object, predicate, ...)
# S4 method for DFrame,`function`
selectIf(object, predicate)
Arguments
- object
Object.
- predicate
function
. A predicate function to be applied to the columns. For example,is.atomic()
.- ...
Additional arguments.
See also
These functions are inspired by dplyr. However, they are designed to only
work on DFrame
class, and use base R code internally.
`help(topic = "select_all", package = "dplyr")`
Examples
data(iris, package = "datasets")
## DFrame ====
x <- as(iris, "DFrame")
selectIf(x, predicate = is.factor)
#> DataFrame with 150 rows and 1 column
#> Species
#> <factor>
#> 1 setosa
#> 2 setosa
#> 3 setosa
#> 4 setosa
#> 5 setosa
#> ... ...
#> 146 virginica
#> 147 virginica
#> 148 virginica
#> 149 virginica
#> 150 virginica