Description Usage Arguments See Also Examples
View source: R/conditional_dplyr.R
Apply a filter if condition is met. This function is a simple wrapper for
filter
1 | conditional_filter(df1, cond, varName, varCond)
|
df1 |
A dataframe |
cond |
A logical value indicating if filter should be applied |
varName |
Name of variable to filter on |
varCond |
A single value for equality filter or a vector for is member filter |
Other conditional dplyr: conditional_mutate
,
conditional_range_filter
,
conditional_select
1 2 3 4 5 6 | data(starwars, package = "dplyr")
starwars %>%
conditional_filter(TRUE, "species", "Human")
starwars %>%
conditional_filter(TRUE, "species", c("Human", "Droid"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.