scoreplot {SCOUTer} | R Documentation |
scoreplot
Description
Returns the score plot providing a dataset and a pca model. Observations can be identified by the obstag input argument.
Usage
scoreplot(
X,
pcamodel,
obstag = matrix(0, nrow(X), 1),
pcx = 1,
pcy = 2,
alpha = 0.05,
plottitle = "Score plot\n"
)
Arguments
X |
Matrix with the data to be displayed. |
pcamodel |
List wiht 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 compuatation of the confidence ellipse,
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")
scoreplot(X, pcamodel.ref)
tags <- dotag(X[1:40,], X[-c(1:40),])
scoreplot(X, pcamodel.ref, obstag = tags, pcx = 2, pcy = 3, alpha = 0.1, plottitle = "T-plot")
[Package SCOUTer version 1.0.0 Index]