docs/functions/set.color.scheme.md

set.color.scheme

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

Description

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

Usage

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

Arguments

Argument |Description ------------- |---------------- colors.x | Which colors to use for datasets (X)? Must be a vector of length SPEARobj$data$train$Xlist. If not named, will assume order matches. colors.y | Which colors to use for the response (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.