Learn R Programming

rapport (version 0.31)

rp.palette: Color palettes

Description

This function returns a given number of color codes from given palette from RColorBrewer. Besides those falling back to 'default': a color-blind-friendly palette from http://jfly.iam.u-tokyo.ac.jp/color/.

Usage

rp.palette(num,
    palette = getOption("style.color.palette"),
    colorize = getOption("style.colorize"))

Arguments

num
number of colors to return
palette
a palette name from RColorBrewer or 'default'
colorize
if set colors are chosen from palette at random order

Details

Default parameters are read from options:

  • 'style.color.palette',
  • 'style.colorize'.

Examples

Run this code
{
rp.palette()
rp.palette(1)
rp.palette(1, colorize = TRUE)
rp.palette(5, 'Greens')
rp.palette(5, 'Greens', colorize = TRUE)
}

Run the code above in your browser using DataLab