Creates an object of hexcode colors with names given a vector of characters.
This function is built into the ordination method from the abstract class omics and inherited by other omics classes, such as;
metagenomics and proteomics.
Arguments
- data
A data.frame or data.table.
- col_name
A column name of a categorical variable.
- Brewer.palID
A character name that exists in brewer.pal (Default:
"Set2").
Value
A setNames.
Examples
library("data.table")
dt <- data.table(
"SAMPLE_ID" = c("sample_1", "sample_2", "sample_3"),
"treatment" = c("healthy", "tumor", NA)
)
colors <- colormap(data = dt,
col_name = "treatment")
