如何使用带有列表中通配符的dplyr过滤行。就像下面df下方的
> dput(df)
structure(list(x = structure(c(1L, 2L, 5L, 4L, 3L), .Label = c("axyzr",
"bmnoc", "dbcdg", "hejd", "hsjj"), class = "factor")), .Names = "x", row.names = c(NA,
-5L), class = "data.frame")
我想使用下面的列表进行过滤
> fltr <- c('xyz','mno','bcd')
类似
> df %>% filter(x %like% fltr)
得到
x
1 axyzr
2 bmnoc
5 dbcdg