annotate_cat: Generate colors and ids for categorical annotations. From...

annotate_catR Documentation

Generate colors and ids for categorical annotations. From library(scrattch.io)

Description

Generate colors and ids for categorical annotations. From library(scrattch.io)

Usage

annotate_cat(df, col = NULL, base = NULL, sort_label = T,
  na_val = "ZZ_Missing", colorset = "varibow", color_order = "sort")

Arguments

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.

Value

A modified data frame: the annotated column will be renamed base_label, and base_id and base_color columns will be appended


AllenInstitute/L5_VEN documentation built on July 31, 2022, 6:32 p.m.