Learn R Programming

extracat (version 1.6-3)

getcolors: Create a color vector

Description

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

Usage

getcolors(N, palette, col.opt)

Arguments

N
Number of colors.
palette
Palette shortcut: rlll{ "rgb","hsv" RGB rainbow colors. See rainbow. "hcl" HCL rainbow colors. See rainbow
col.opt
Options for the palette. See help pages for the specific palettes.

Value

  • A color vector.

References

Martijn Wijffelaars. Synthesis of Color Palettes. PhD thesis, TECHNISCHE UNIVERSITEIT EINDHOVEN, 2008.

Examples

Run this code
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()

Run the code above in your browser using DataLab