It´s always nice (when testing a new package from the several chemometric packages), use other packages to get nice plots and information.
Now, that I am using again the Principal Components, is a good occasion to use packages as: "scatterplot3d", "rgl" or "Rcmdr" (you can download it, and install it from the CRAN Servers), to see the scores, and have better idea a.
In the previous pots we saw how to get the matrix of scores "T" in the principal components projections with Resemble: "pcProj$scores".
So now we just have to load scatterplot3d library:
and plot the scores for the first 3 PCs:
>scatterplot3d(pcProj$scores[,1:3], color = "blue", angle = 55, scale.y = 0.7, pch = 16)
After the plot appears:
We can see also the projections of the scores over the plane formed by PC1 and PC2:
scatterplot3d(pcProj$scores[,1:3], highlight.3d =TRUE,
angle = 120,type="h",col.axis = "blue",
col.grid = "lightblue",cex.axis = 1.3,
cex.lab = 1.1,pch = 20)
Now install the package "rgl" and load it:
library(rgl) plot3d(pcProj$scores[,1:3], col="blue", size=3)
We can rotate with the mouse the cube in order to check better the population.
Another nice way to see the scores and projections in 3D is loading the package Rcmdr, and in the function "scatter3d", we select 3 columns of the T (scores) matrix. We can move it with the mouse in order to select the best side to look to the scores.