default.grin.colors: Assign Default GRIN Colors

View source: R/default.grin.colors.R

default.grin.colorsR Documentation

Assign Default GRIN Colors

Description

Assigns a default set of colors to lesion types for use in GRIN plots.

Usage

default.grin.colors(
  lsn.types
)

Arguments

lsn.types

A character vector of lesion types, typically obtained from the "lsn.type" column of lesion data. Duplicate lesion types are automatically removed and the remaining lesion types are sorted before colors are assigned.

Details

This function assigns colors from a predefined palette of up to 10 colors. Colors are assigned to unique lesion types in alphabetical order. If more than 10 unique lesion types are provided, custom colors must be specified manually in the plotting function.

Value

A named character vector in which names correspond to the unique lesion types and values correspond to their assigned colors.

Author(s)

Abdelrahman Elsayed abdelrahman.elsayed@stjude.org, Stanley Pounds stanley.pounds@stjude.org

Examples

data(lesion_data)

# Extract unique lesion types
lsn.types <- unique(lesion_data$lsn.type)

# Assign default colors to lesion types
default.grin.colors(lsn.types)

GRIN2 documentation built on Aug. 22, 2026, 5:09 p.m.