colormap | R Documentation |
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.
colormap(data, col_name, Brewer.palID = "Set2")
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: |
A setNames.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.