Create a list of colors from among a variety of color palettes.
chooseColors(pal = paletteChoices(), num, rev = FALSE, ...)paletteChoices()
A character that is the name of a palette. Must be one of “rich”, “cm”, “default”, “grey”, “gray”, “heat”, “jet”, “rainbow”, “topo”, or “terrain”, which are given in paletteChoices
.
The number of colors to be returned.
A logical that indicates if the default order of colors should be reversed (=TRUE
) or not (=FALSE
).
Other arguments to the various palette functions.
A vector of colors of length num
.
See rich.colors
in gplots, cm.colors
, heat.colors
, topo.colors
, terrain.colors
, rainbow
, colorRampPalette
, and colors
.
# NOT RUN {
n <- 20
# Color Wheels
pie(rep(1,n), col=chooseColors("rich",n))
pie(rep(1,n), col=chooseColors("rainbow",n))
pie(rep(1,n), col=chooseColors("topo",n))
pie(rep(1,n), col=chooseColors("gray",n))
pie(rep(1,n), col=chooseColors("jet",n))
# colors reversed order
pie(rep(1,n), col=chooseColors("jet",n,rev=TRUE))
# }
Run the code above in your browser using DataLab