sinhrks / ggfortify

Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages.
Other
525 stars 65 forks source link

documentation not ideal: autoplot extension for PCA objects #200

Closed tjebo closed 4 years ago

tjebo commented 4 years ago

https://cran.r-project.org/web/packages/ggfortify/vignettes/plot_pca.html

the documentation for the autoplot extension is not ideal. The PCA yields weird results - you need to scale the data set first. That this creates some confusion, was shown by the recent Stackoverflow thread in which your documentation example was copied exactly - and resulting in a wrong PCA.

prcomp(iris[1:4], scale. = TRUE) would be the better way of doing the PCA!

tjebo commented 4 years ago

I've created a pull request. It is my first pull request ever and I am not sure if this was the way to go. I edited here on GitHub (god forbid!), and did not even try to re-document everything, so don't know how useful this was.