library(dplyr)
home.dests <- c("St Louis, MO", "New York, NY", "Hudson, NY")
# Subsetting using %in% in R:
dataf %>%
filter(home.dest %in% home.dests)
Code language: R (r)
1:2 %in% rep(1:2,5)
#[1] TRUE TRUE
rep(1:2,5) %in% 1:2
#[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#Note this output is longer in second
by_type_year_tag_filtered <- by_type_year_tag %>%
filter(tag_name %in% c("dplyr", "ggplot2"))