fac2col: Translates a factor into colors.

View source: R/miscellanous.R

fac2colR Documentation

Translates a factor into colors.

Description

Translates a factor into colors.

Usage

fac2col(x, col.pal = funky_color, na.col = "grey", seed = NULL)

Arguments

x

a numeric vector (for num2col) or a vector converted to a factor (for fac2col).

col.pal

(default funky_color) a function generating colors according to a given palette.

na.col

(default grey) the color to be used for missing values (NAs)

seed

(default NULL) a seed for R's random number generated, used to fix the random permutation of colors in the palette used; if NULL, no randomization is used and the colors are taken from the palette according to the ordering of the levels

Value

a color vector

Author(s)

Thibaut Jombart in adegenet package

See Also

The R package RColorBrewer, proposing a nice selection of color palettes. The viridis package, with many excellent palettes


adrientaudiere/MiscMetabar documentation built on May 1, 2024, 6:22 a.m.