get_gg_colors | R Documentation |
Given a character or numeric vactor x
, the function returns the named vector of default ggplot colors of length length(x)
. The names will be elements of x
and values will be unique color associated to each element of x
.
get_gg_colors(x)
x |
internal |
internal
## Not run:
x <- letters[1:5]
gg_col = get_gg_colors(x)
## visualize colors
pie(seq_len(length(x)) / seq_len(length(x)) ,labels = x , col=gg_col)
y <- LETTERS[ 1:5]
visualize colors
get_gg_colors(y)
pie(seq_len(length(y)) / seq_len(length(y)) ,labels = y , col=gg_col)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.