Learn R Programming

a4 (version 1.20.0)

a4palette: Utility function that defines a color palette for use in a4

Description

Utility function that defines a color palette for use in a4.

Usage

a4palette(n, alpha = 1, Janssen = FALSE)

Arguments

n
Number of color levels the palette should provide
alpha
alpha transparency level of the colors
Janssen
logical. If TRUE, Janssen Pharmaceutical colors are used (with a maximum of 6 possible colors).

Value

  • a character vector of colors

Details

For n = 1, "blue" is returned; for n = 2 c("red", "blue") is returned; for n = 3 c("red", "green", "blue" is returned; for n = 4 c("red", "green", "blue", "purple") is returned and for n > 2, the output of rainbow(n) is returned.

See Also

rainbow

Examples

Run this code
op <- par(mfrow = c(2, 3))
  for (nGroups in 1:6)
    pie(rep(1, nGroups), a4palette(nGroups))
  par(op)

Run the code above in your browser using DataLab