This selection helper selects the variables for which a function returns TRUE
.
where(fn)
A function that returns TRUE
or FALSE
.
A vector of integer
column positions which are the result of the fn
evaluation.
# NOT RUN {
iris %>% select(where(is.numeric))
iris %>% select(where(function(x) is.numeric(x)))
iris %>% select(where(function(x) is.numeric(x) && mean(x) > 3.5))
# }
Run the code above in your browser using DataLab