Skip to content

This allows you to set custom palettes individually for groups in the dataset

Usage

set_color_pal(moo, colname, palette_fun = grDevices::palette.colors, ...)

Arguments

moo

multiOmicDataSet object (see create_multiOmicDataSet_from_dataframes())

colname

group column name to set the palette for

palette_fun

Function for selecting colors. Assumed to contain n for the number of colors. Default: grDevices::palette.colors()

...

additional arguments forwarded to palette_fun

Value

moo with colors updated at moo@analyses$colors$colname

Examples

moo <- create_multiOmicDataSet_from_dataframes(
  sample_metadata = as.data.frame(nidap_sample_metadata),
  counts_dat = as.data.frame(nidap_raw_counts)
)
moo@analyses$colors$Group
#>         A         B         C 
#> "#000000" "#E69F00" "#56B4E9" 
moo %<>% set_color_pal("Group", palette_fun = RColorBrewer::brewer.pal, name = "Set2")
moo@analyses$colors$Group
#>         A         B         C 
#> "#66C2A5" "#FC8D62" "#8DA0CB"