distplot {SCOUTer} | R Documentation |
Returns the distance plot providing a dataset and a Principal Component Analysis model.
distplot(
X,
pcaref,
obstag = matrix(0, nrow(X), 1),
plottitle = "Distance plot\n"
)
X |
data matrix with observations to be displayed in the distance plot. |
pcaref |
list with the information of the PCA model. |
obstag |
Optional column vector of integers indicating the group of each
observation ( |
plottitle |
Optional string with the plot title. Set to |
Coordinates are expressed in terms of the Hotelling's T^2 (x-axis) and the Squared Prediction Error (y-axis) obtained projecting X on the provided model. Observations can be identified by the obstag input argument.
ggplot object with the distance plot.
X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X, 2, 0.05, "cent")
distplot(X, pcamodel.ref)
tags <- dotag(X[1:40,], X[-c(1:40),])
distplot(X, pcamodel.ref, obstag = tags, plottitle = "D plot title")