Creates a color vector using different palettes, e.g. from the colorspace package.

getcolors(N, palette, col.opt = list(), revert = FALSE)

Arguments

N

Number of colors.

palette

Palette shortcut:

"rgb","hsv"
RGB rainbow colors. Seerainbow.
"hcl"HCL rainbow colors. See
rainbow_hcl.
"s","seq","sqt","sqn","sequential"Seesequential_hcl
"d","div","diverging","diverge"
Seediverge_hcl
"h","heat","heatcolors"
Seeheat_hcl
"t","ter","terrain"See
terrain_hcl
"Wijffelaars","w","wijf", "q17"A fixed vector of 17 qualitative colors defined by Wijffelaars (2008).
.defined by Wijffelaars (2008).
col.opt

Options for the palette. See help pages for the specific palettes.

revert

Logical. The color vector is returned in reverse order.

Value

A color vector.

References

Martijn Wijffelaars. Synthesis of Color Palettes. PhD thesis, Technische Universiteit Eindhoven, 2008.

Examples

# NOT RUN {
require(MASS)
mat.layout <- grid.layout(nrow = 2 , ncol = 2)
vp.mat <- viewport(layout = mat.layout)
pushViewport(vp.mat)
rmb(formula = ~Type+Infl+Cont+Sat, data = housing, col = "rgb", vp = c(1,1))
rmb(formula = ~Type+Infl+Cont+Sat, data = housing, col = "q17", vp = c(1,2))
rmb(formula = ~Type+Infl+Cont+Sat, data = housing, col = "hcl", vp = c(2,1))
rmb(formula = ~Type+Infl+Cont+Sat, data = housing, col = "seq", vp = c(2,2))
popViewport()
# }