Description Usage Arguments Value Examples
View source: R/view_plsda_xloadings.R
Show the correlation circle plot of the loadings by component from the partial least squares discriminant analysis.
1 2 | view_plsda_xloadings(model, comps = 1:2, renaming.x = function(x) x,
title = NULL)
|
model |
The PLS-DA model generated from |
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. |
Prints the loadings of the X in PLS-DA by two components, with circles indicating 50
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.