| sopls_plots | R Documentation |
Extraction of scores and loadings and adaptation of scoreplot,
loadingplot and biplot from package pls for sopls objects.
## S3 method for class 'sopls'
loadings(object, ncomp = "all", block = 1, y = FALSE, ...)
## S3 method for class 'sopls'
scores(object, ncomp = "all", block = 1, y = FALSE, ...)
## S3 method for class 'sopls'
scoreplot(
object,
comps = 1:2,
ncomp = NULL,
block = 1,
labels,
identify = FALSE,
type = "p",
xlab,
ylab,
...
)
## S3 method for class 'sopls'
loadingplot(
object,
comps = 1:2,
ncomp = NULL,
block = 1,
scatter = TRUE,
labels,
identify = FALSE,
type,
lty,
lwd = NULL,
pch,
cex = NULL,
col,
legendpos,
xlab,
ylab,
pretty.xlabels = TRUE,
xlim,
...
)
## S3 method for class 'sopls'
corrplot(
object,
comps = 1:2,
ncomp = NULL,
block = 1,
labels = TRUE,
col = 1:5,
plotx = TRUE,
ploty = TRUE,
...
)
## S3 method for class 'sopls'
biplot(
x,
comps = 1:2,
ncomp = "all",
block = 1,
which = c("x", "y", "scores", "loadings"),
var.axes = FALSE,
xlabs,
ylabs,
main,
...
)
object |
|
ncomp |
|
block |
|
y |
|
... |
further arguments sent to the underlying plot function(s) |
comps |
|
labels |
|
identify |
|
type |
|
xlab |
|
ylab |
|
scatter |
|
lty |
Vector of line type specifications (see |
lwd |
|
pch |
Vector of point specifications (see |
cex |
|
col |
|
legendpos |
|
pretty.xlabels |
|
xlim |
|
plotx |
|
ploty |
|
x |
|
which |
|
var.axes |
|
xlabs |
|
ylabs |
|
main |
|
If comps is supplied as a list for scoreplot, it is assumed that its elements refer to each of the
blocks up to block number block. For instance comps = list(1, 0, 1:2) will select 1 component from the first
block, no components from the second block and the first two components from the last block. This must be
matched by ncomp, specifying how many components were selected before block number block.
Overviews of available methods, multiblock, and methods organised by main structure: basic, unsupervised, asca, supervised and complex.
Common functions for computation and extraction of results are found in sopls_results.
#' @return The score and loading functions return scores and loadings, while plot functions have no return (except use of 'identify').
data(potato)
so <- sopls(Sensory ~ Chemical + Compression + NIRraw, data=potato, ncomp=c(5,5,5))
# Loadings
loadings(so, ncomp=c(3), block=2)[, 1:3]
# Scores
scores(so, block=1)[, 1:4]
# Default plot from first block
scoreplot(so)
# Second block with names
scoreplot(so, ncomp=c(3), block=2, labels="names")
# Scatterplot matrix
scoreplot(so, ncomp=c(3,2), block=3, comps=1:3)
# Combination of blocks (see Details)
scoreplot(so, ncomp=c(3,2), block=3, comps=list(1,0,1))
# Default plot from first block
loadingplot(so, scatter=TRUE)
# Second block with names
loadingplot(so, ncomp=c(3), block=2, labels="names", scatter=TRUE)
# Scatterplot matrix
loadingplot(so, ncomp=c(3,2), block=3, comps=1:3, scatter=TRUE)
# Correlation loadings
corrplot(so, block=2, ncomp=1)
# Default plot from first block
biplot(so)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.