palettize: Creates a color vector from a factor and a palette name

Description Usage Arguments Examples

Description

Can be used in conjunction with add_* functions.

Usage

1

Arguments

f

factor (or another type of vector coerced as factor) as a grouping informations for colors to be returned

palette

a color palette that, given a integer return a color code.

Examples

1
2
3
4
5
6
7
8
# creates a palette
w2b <- colorRampPalette(c("#FFFFFF", "#000000"))
# displays it
barplot(rep(1, 5), col=w2b(5))
# with palettize
palettize(iris$Species, w2b)
# alternatively you can use existing palettes
palettize(iris$Species, Momocs::col_summer)

vbonhomme/Momosaics documentation built on May 4, 2019, 10:56 a.m.