annotate_cat | R Documentation |
Generate colors and ids for categorical annotations. From library(scrattch.io)
annotate_cat(df, col = NULL, base = NULL, sort_label = T, na_val = "ZZ_Missing", colorset = "varibow", color_order = "sort")
df |
data frame to annotate |
col |
name of the character column to annotate |
base |
base name for the annotation, which wil be used in the desc table. If not provided, will use col as base. |
sort_label |
a logical value to determine if the data in col should be arranged alphanumerically before ids are assigned. default = T. |
na_val |
The value to use to replace NAs. default = "ZZ_Missing". |
colorset |
The colorset to use for assigning category colors. Options are "varibow" (default), "rainbow","viridis","inferno","magma", and "terrain" |
color_order |
The order in which colors should be assigned. Options are "sort" and "random". "sort" assigns colors in order; "random" will randomly assign colors. |
A modified data frame: the annotated column will be renamed base_label, and base_id and base_color columns will be appended
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.