Hi,
Thanks a lot for your help. This seems to work. However, I can get the PCA plot, but, facing a lot of issues with the legends. I am very new to R, let alone, scatterplot3d nuances. I have a total of 22 populations and I want different shapes/patterns for each of them. I modified your code to something like this to make it work.
with(df, scatterplot3d(PC1, PC2, PC3, color = as.numeric(POPULATION), pch=as.numeric(POPULATION), main="PCA 3D Plot"))
Now, I can't get the legends to work, as when I give
with(df, legend("topleft", pch=as,numeric(POPULATION) col=as.numeric(POPULATION), legend=c(---22 POPULATION NAMES---))
This, doesn't seem to work. Can you help me rectify this. Again, thanks a lot for your code, the 3d scatter-plot works very well. I was trying Genesis, but it takes forever to load the data.
Make sure you really need to plot all 3 components - how much variance they explain? 2D graphs are always simpler than 3D graphs.
how to plot in 2D using eigen vectors (.evec file)