Select multiple columns

selectIf(object, predicate, ...)

# S4 method for DataFrame,`function`
selectIf(object, predicate)

Arguments

object

Object.

predicate

function. A predicate function to be applied to the columns. For example, is.atomic().

...

Additional arguments.

Value

Modified object.

Note

Updated 2019-08-26.

See also

These functions are inspired by dplyr. However, they are designed to only work on DataFrame class, and use base R code internally.

`help(topic = "select_all", package = "dplyr")`

Examples

data(iris, package = "datasets") ## DataFrame ==== x <- as(iris, "DataFrame") 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