Description Usage Arguments See Also Examples
View source: R/conditional_dplyr.R
Perform select if condition is met. This function is a simple wrapper for
select
1 | conditional_select(df1, cond, user_expr)
|
df1 |
A dataframe |
cond |
A logical value indicating if select should be performed |
user_expr |
Select expression |
Other conditional dplyr: conditional_filter
,
conditional_mutate
,
conditional_range_filter
1 2 3 4 5 6 | mtcars %>%
dplyr::as_tibble() %>%
conditional_select(
exists("cyl", where = .),
user_expr = -cyl
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.