scoreplotsimple {SCOUTer} | R Documentation |
scoreplotsimple
Description
Returns the score plot providing the scores matrix, T. Observations can be identified by the obstag input argument.
Usage
scoreplotsimple(
Tscores,
pcx = 1,
pcy = 2,
obstag = matrix(0, nrow(Tscores), 1),
alpha = 0.05,
varT = stats::var(Tscores),
plottitle = "Score plot\n"
)
Arguments
Tscores |
Matrix with the scores to be displayed, with the information of each Principal Component (PC) stored by columns. |
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 |
obstag |
Optional column vector of integers indicating the group of each
observation ( |
alpha |
Optional number between 0 and 1 expressing the type I risk assumed in the
computation of the confidence ellipse, set to |
varT |
Optional parameter expressing the variance of each PC. Set to |
plottitle |
Optional string with the plot title. 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")
pcaproj <- pcame(X, pcamodel.ref) # Project last observations
scoreplotsimple(pcaproj$Tscores)
pcaproj <- pcame(X[-c(1:40),], pcamodel.ref) # Project all observations
tags <- dotag(X[1:40,], X[-c(1:40),]) # 0's for observations used in PCA-MB
scoreplotsimple(pcaproj$Tscores, pcx = 2, pcy = 3, obstag = tags)