set.color.scheme: Set the colors for a SPEAR object, to be used in plotting...

View source: R/2_helpers.R

set.color.schemeR Documentation

Set the colors for a SPEAR object, to be used in plotting functions

Description

Set the colors for a SPEAR object, to be used in plotting functions

Usage

set.color.scheme(colors.x = NULL, colors.y = NULL)

Arguments

colors.x

Which colors to use for assays (X)? Must be a vector of length SPEAR$data$train If not named, will assume order matches.

colors.y

Which colors to use for the response(s) (Y)? Must be a vector of length ncol(SPEARobj$data$train$Y). If not named, will assume order matches.

Examples

SPEARobj <- make.SPEARobject(...)

# Option 1: set to defaults:
SPEARobj$set.color.scheme()

# Option 2: provide colors:
colors.x <- c("red", "blue", "green", ...) # one for each dataset in SPEARobj$data$train$Xlist
colors.y <- c("yellow", ...) # one for each column in SPEARobj$data$train$Y
SPEARobj$set.color.scheme(colors.x = colors.x, colors.y = colors.y)

# Option 3: provide colors as named list:
colors.x <- c("red", "blue", "green", ...) # one for each dataset in SPEARobj$data$train$Xlist
names(colors.x) <- names(SPEARobj$data$train$Xlist)
colors.y <- c("yellow", ...) # one for each column in SPEARobj$data$train$Y
names(colors.y) <- colnames(SPEARobj$data$train$Y)
SPEARobj$set.color.scheme(colors.x = colors.x, colors.y = colors.y)


jgygi/SPEAR documentation built on July 5, 2023, 5:35 p.m.