plot.factor.scores: Plot factor scores from a SPEARobject for a particular...

View source: R/2_helpers.R

plot.factor.scoresR Documentation

Plot factor scores from a SPEARobject for a particular dataset 'data'.

Description

Plot factor scores from a SPEARobject for a particular dataset 'data'.

Usage

## S3 method for class 'factor.scores'
plot(
  data = "train",
  cv = FALSE,
  group = "response",
  factors = NULL,
  plot.type = "violin",
  show.legend = FALSE,
  scale = TRUE
)

Arguments

data

Which dataset to use? Can be any dataset listed under '$data$____'. Defaults to '"train"'.

cv

If 'data = "train"', get factor scores generated from '$run.cv.spear'? If '$run.spear' was used or if 'data != "train"' this parameter is ignored. Defaults to 'FALSE'. NOTE: There is an element of randomness if the factor scores are not correlated with the response, so it is recomended to view the factor scores with 'cv = FALSE'

group

What to plot on the x.axis? Defaults to "response" (indicated by $options$current.response.idx), but can be any feature name found in colnames(SPEARobj$data$train$X)

factors

Which factors to show? Defaults to 'NULL' (all factors). Use a vector of integers (i.e. 'c(1, 2, 4)') to specify fewer factors.

plot.type

Which type of plot (for 'ordinal', 'binomial', and 'multinomial' families)? Can be '"violin"' (default) or '"boxplot"'. Ignored if 'family == "gaussian"'.

show.legend

Show the legend of the plot (for 'group')? Defaults to 'FALSE'


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