Last active
March 31, 2018 04:44
-
-
Save cecilialee/ee46463ff8f1a272e96ef0e8f33bee81 to your computer and use it in GitHub Desktop.
Filter text in any columns in R. #r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
search <- "color" | |
iris %>% | |
filter_all(any_vars(grepl(search, ., ignore.case = TRUE))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment