char2col: Creates palette for character vector

View source: R/general.purpuse.utilities.R

char2colR Documentation

Creates palette for character vector

Description

Sorts t numerically if possible, alphabetically otherwise.

Usage

char2col(
  t,
  bpal = "Set1",
  colfun = randomcoloR::distinctColorPalette,
  palette = TRUE,
  random.seed = 1234
)

Arguments

t

input character vector

bpal

RColorBrewer pallete to be used if number of colors allows

colfun

pallete function to be used in number of colors 10 or more

palette

logical, specifies whether pallete (color per unique value in t) or colour along t should be returned

random.seed

seed to be set befor color generation (for stochastic colfuns)

Value

names colour vector

Examples

char2col(c('a','a','b'))
char2col(c(1,1,11,2))
char2col(c(T,F))

iaaka/visutils documentation built on Jan. 17, 2025, 11:29 p.m.