dscplot {SCOUTer} | R Documentation |
dscplot
Description
Returns the distance plot and the score plot providing a data matrix and a Principal Component Analysis (PCA) model. Observations can be identified by the obstag input argument.
Usage
dscplot(
X,
pcamodel,
obstag = matrix(0, nrow(X), 1),
pcx = 1,
pcy = 2,
alpha = 0.05,
nrow = 1,
ncol = 2,
legpos = "bottom"
)
Arguments
X |
Matrix with the data to be displayed. |
pcamodel |
List with the PCA model elements. |
obstag |
Optional column vector of integers indicating the group of each
observation ( |
pcx |
Optional integer with the number of the PC in the horizontal axis.
Set to |
pcy |
Optional integer with the number of the PC in the vertical axis.
Set to |
alpha |
Optional number between 0 and 1 expressing the type I risk assumed in
the computation of the confidence ellipse,
set to |
nrow |
Optional number of rows the plot layout. Set to |
ncol |
Optional number of columns the plot layout. Set to |
legpos |
Optional string with the position of the legend. Set to |
Value
ggplot object with the generated score plot.
Examples
X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X[1:40,], 3, 0.05, "cent")
dscplot(X, pcamodel.ref)
dscplot(X, pcamodel.ref, nrow = 2, ncol = 1)
tags <- dotag(X[1:40,], X[-c(1:40),])
dscplot(X, pcamodel.ref, obstag = tags, pcy = 3)