ExtendPalette: Extends a base-palette of the package RColorBrewer to n...

View source: R/palette.R

ExtendPaletteR Documentation

Extends a base-palette of the package RColorBrewer to n colors.

Description

The colors in the returned palette are always in the same order

Usage

ExtendPalette(n = NULL, base = "Set1")

Arguments

n

The number of desired colors in the palette

base

The name of the palette of the package RColorBrewer from which the extended palette is built. Default value is 'Set1'.

Value

A vector composed of n color code.

Author(s)

Samuel Wieczorek

Examples

ExtendPalette(12)
nPalette <- 10
par(mfrow=c(nPalette,1))
par(mar=c(0.5, 4.5, 0.5, 0.5))
for (i in 1:nPalette){
  pal <- ExtendPalette(n=i, base = 'Dark2')
  barplot(1:length(pal), col=pal)
  print(pal)
}


samWieczorek/DAPAR documentation built on May 6, 2022, 5:30 p.m.