generate_group_colors: create set of disjoint colors

View source: R/heatmaps.R

generate_group_colorsR Documentation

create set of disjoint colors

Description

When multiple sample classes need to be visualized on a heatmap, it is useful to be able to distinguish them by color. This function generates a set of colors for sample classes

Usage

generate_group_colors(n_group, randomize = NULL)

Arguments

n_group

how many groups should there be colors for

randomize

should colors be randomized? (default is NULL). See details.

Details

the default for randomize is NULL, so that reordering the colors randomly is decided purely based on the number of colors requested. Currently, that cutoff is 5 colors, less than that the colors will always be in the same order, for 5 colors or more, they will be in a scrambled order, different each time unless set.seed is used. If randomize is TRUE or FALSE, then it overrides the defaults.


MoseleyBioinformaticsLab/visualizationQualityControl documentation built on Feb. 21, 2024, 1:06 a.m.