cbf_palette: A colour-blind friendly colour palette

View source: R/cbf_palette.R

cbf_paletteR Documentation

A colour-blind friendly colour palette

Description

cbf_palette returns a colour friendly palette

Usage

cbf_palette(x = 8, named = FALSE)

Arguments

x

numeric/character/factor

named

logical should the vector be named. default = FALSE

Details

These colours come from https://jfly.uni-koeln.de/color Accepts either a number, or a character/factor vector If the supplied vale is a number, a vector of the specified length is returned. If a character vector is supplied, a vector of the same length is returned. If a factor vector is supplied, a vector of the same length as the number of factor levels is returned.

If the length of the requested palette is greater than 8, a warning is generated. If the length is 9 or 10, a palette containing greys is returned with a warning. If the length greater than 10, a palette of length 10 containing greys is returned with a warning.

If no value supplied the a palette of 8 colours is returned. This palette is intended for categorical data.

Value

named vector of colours

Examples

cbf_palette()

cbf_palette(4)


richysix/biovisr documentation built on Feb. 3, 2024, 4:36 a.m.