Description Usage Arguments Details Value Examples
Search and highlight occurences of a pattern in a data frame
1 |
x |
a data frame |
pattern |
a pattern; if NULL, the search results will be removed |
cols |
which columns to search for (if NULL, all columns will be searched) |
df_search is for highlighting cells matching a specific pattern.
a color data frame object with the search pattern set for the given columns (or reset, if the pattern was NULL)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | options(colorDF_tibble_style=TRUE)
if(require(dplyr)) {
# Search for "blue" in any column
starwars %>% df_search("blue")
# Search in a specific column
starwars %>% df_search("(Human|Wookie)", "species")
# save the search pattern in a new object
saved <- starwars %>% df_search("blue")
# remove the search patterns
saved <- df_search(saved)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.