rainbow | R Documentation |
rainbow
is useful for getting a set of colors for graphs when you need
a LOT of colors; there are prettier and more easily distinguishable options
if you only have a couple of comparisons.
rainbow(ncolors, shade = "regular")
ncolors |
number of colors desired |
shade |
the shade of colors to use, which can be "regular" (default), "darker", "lighter", or "muted" (although "muted" in this case is the same as "darker") |
a character vector of colors
# Create a rainbow of 10 colors.
rainbow(10)
# Try using scales::show_col() to visualize the colors, ex:
scales::show_col(rainbow(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.