grepal("tan")
# With regular expressions:
some_grey <- grepal("gr(a|e)y", plot = FALSE)
start_grey <- grepal("^gr(a|e)y", plot = FALSE)
only_grey <- grepal("^gr(a|e)y$", plot = FALSE)
length(some_grey)
length(only_grey)
# With other color objects (df as x):
grepal("blau", x = pal_unikn)
grepal("SEE", x = pal_unikn_pref, ignore_case = FALSE)
# Applications:
seecol(grepal("white"), col_bg = "lightblue2", main = "See 'white' colors()")
olives <- grepal("olive", plot = FALSE)
oranges <- grepal("orange", plot = FALSE)
seecol(list(olives, oranges),
pal_names = c("olives", "oranges"),
main = "Comparing olives and oranges")
Run the code above in your browser using DataLab