view_plsda_xloadings: Plot the x loadings by components for PLS-DA models.

Description Usage Arguments Value Examples

View source: R/view_plsda_xloadings.R

Description

Show the correlation circle plot of the loadings by component from the partial least squares discriminant analysis.

Usage

1
2
view_plsda_xloadings(model, comps = 1:2, renaming.x = function(x) x,
  title = NULL)

Arguments

model

The PLS-DA model generated from plsda.

comps

The component numbers, e.g. for the first 2 it would be '1:2', for the first and third, 'c(1,3)', and so on.

renaming.x

A function to renaming the x variables for the PLS model.

title

The main title of the plot.

Value

Prints the loadings of the X in PLS-DA by two components, with circles indicating 50

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# most of this example data is taken from the ?caret::plsda help.
library(caret)
data(mdrr)
set.seed(1)
inTrain <- sample(seq(along = mdrrClass), 450)
nzv <- nearZeroVar(mdrrDescr)
filteredDescr <- mdrrDescr[, -nzv]
training <- filteredDescr[inTrain,]
trainMDRR <- mdrrClass[inTrain]
preProcValues <- preProcess(training)
trainDescr <- predict(preProcValues, training)
fit   <- plsda(trainDescr, trainMDRR, ncomp = 5,
                    probMethod = "Bayes")
view_plsda_xloadings(fit)
view_plsda_xloadings(fit, title = 'Multidrug Resistance Reversal (MDRR) Agent Data: PLS-DA results')
view_plsda_xloadings(fit, title = 'Near-infrared radiation',
 renaming.x = function(x) gsub('RB', 'Protein ', x))

## End(Not run)

lwjohnst86/seer documentation built on May 21, 2019, 9:15 a.m.