#' Filter for observations using a character vector of included values
#' @param filter_col column targetted for filtering
#' @param inclusion_vector character vector of values to be included
#' @importFrom magrittr %>%
#' @importFrom dplyr filter_at
#' @export
filter_for_vector <-
function(dataframe, filter_col, inclusion_vector) {
filter_col <- enquo(filter_col)
dataframe %>%
filter_at(vars(!!filter_col), any_vars(grepl(paste(inclusion_vector, collapse = "|"), .) == TRUE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.