View source: R/data-multi_filt.R
multi_filt | R Documentation |
Filter across multiple variables.
multi_filt(data, vars, filts)
data |
data |
vars |
variables |
filts |
filters |
NOTE: this function currently only supports character and factor level
filtering by using the dplyr::filter(<var> %in% c(<filts>))
syntax. For numeric
and date level filtering will need to incorporate expressions like <= 5
as
filt
arguments.
a filtered data.frame
or tibble
.
dplyr::filter()
rlang tidyeval
tidyeval glue syntax
library(dplyr) data <- datasets::iris str(data) iris_filtered <- multi_filt(data, vars = list("Species"), filts = list(c("setosa", "versicolor"))) str(iris_filtered) # filtered for only Species %in% c("setosa" and "versicolor")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.