get_colour_set {saros} | R Documentation |
Provide A Colour Set for A Number of Requested Colours
Description
Possibly using colour_palette_nominal if available. If not sufficient, uses a set palette from RColorBrewer.
Usage
get_colour_set(
x,
common_data_type = "factor",
colour_palette_nominal = NULL,
colour_palette_ordinal = NULL,
colour_na = NULL,
colour_2nd_binary_cat = NULL,
ordinal = FALSE,
categories_treated_as_na = NULL,
call = rlang::caller_env()
)
Arguments
x |
Vector for which colours will be found. |
common_data_type |
factor or ordered data type
Currently only supports factor and ordered. |
colour_palette_nominal , colour_palette_ordinal |
User specified colour set
User-supplied default palette, excluding |
colour_na |
Colour for NA category
Colour as a single string for NA values. |
colour_2nd_binary_cat |
Colour for second binary category
Colour for second category in binary variables. Often useful to hide this. |
ordinal |
Is palette ordinal? |
categories_treated_as_na |
NA categories
Categories that should be treated as NA. |
call |
Internal call
Both the absolute and relative folderpaths are required, as strings. |
Value
A colour set as character vector, where NA
has the colour_na
, and the rest are taken from colour_palette_nominal if available.
Examples
get_colour_set(x=1:4)