data(iris)
pc1 <- pcaFit(iris, scale = TRUE, ncomp = NULL)
pc1
print(pc1) #Model summary
plot(pc1) #MSEP
PE(pc1) #X-explained variance
T2(pc1, ncomp = 2) #T2 plot
Xresids(pc1, ncomp = 2) #X-residuals plot
scoresplot(pc1) #scoresplot variable importance
(SC <- ScoreContrib(pc1, obs1 = 1:9, obs2 = 10:11)) #score contribution
plot(SC) #score contribution plot
loadingsplot(pc1, ncomp = 1) #loadings plot
loadingsplot(pc1, ncomp = 1:2) #loadings plot
loadingsplot(pc1, ncomp = 1:3) #loadings plot
loadingsplot(pc1, ncomp = 1:7) #loadings plot
loadingsplot2D(pc1, comps = c(1, 2)) #2-D loadings plot
loadingsplot2D(pc1, comps = c(2, 3)) #2-D loadings plot
Run the code above in your browser using DataLab