set.color.scheme | R Documentation |
Set the colors for a SPEAR object, to be used in plotting functions
set.color.scheme(colors.x = NULL, colors.y = NULL)
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.