View source: R/create_nested_colours.R
create_nested_colours | R Documentation |
Based on a dataframe with two grouping columns, return a named vector of colours for interactions of these groups.
The hues are spaced based on the primary_group, using scales::hue_pal()
, and vary in saturation based
on the secondary_group, using colortools::sequential()
create_nested_colours(df, primary_group, secondary_group, primary_cols = NULL)
df |
data.frame |
primary_group |
name of column containting the primary group (character) |
secondary_group |
name of column containing the secondary group (character) |
primary_cols |
optional set the hues of the colours manually. must be as many hues as there are primary groups (character vector) |
W. S. Drysdake
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.