These functions are used for defining palettes or colors in the epicontacts package. They include:

cases_pal(n)

spectral(n)

char2col(x, pal = cases_pal, NA_col = "lightgrey")

transp(col, alpha = 0.5)

Arguments

n

An integer indicating the number of colors.

x

A character or a factor to be converted to colors.

pal

A color palette.

NA_col

The color to be used for NA values.

col

A color vector to which transparency should be added.

alpha

The threshold to be used for transparency: 0 for full transparency, and 1 for full opacity.

Details

  • cases_pal: discrete color palette used for cases (comes from the dibbler package)

  • spectral: continuous color palette (comes from the adegenet package)

  • transp: makes colors transparent (comes from the adegenet package)

  • char2col: translates a character or a factor to a color using a palette (comes from the adegenet package)

Examples

barplot(1:5, col = cases_pal(5))
barplot(1:50, col = cases_pal(50))