# NOT RUN {
iris %>% select.(where(is.factor))
iris %>% select.(where(is.numeric))
## The formula shorthand
# These expressions are equivalent:
iris %>% select.(where(is.numeric))
iris %>% select.(where(function(x) is.numeric(x)))
iris %>% select.(where(~ is.numeric(.x)))
# This shortahand is useful for adding logic inline.
# Here we select all numeric variables whose mean is greater than 3.5:
iris %>%
select.(where(~ is.numeric(.x) && mean(.x) > 3.5))
# }
Run the code above in your browser using DataLab