Closed YonghuiDong closed 2 years ago
Is this no longer an issue?
Hi@terrytangyuan,
The problem was solved. It was a stupid mistake made by me.
Variance should be calculated as
percentage <-round(pca_res$sdev^2 / sum(pca_res$sdev^2) * 100, 2)
I got exactly the same result as ggfortify
Best regards,
Dong
Great
With autoplot
Self calculated
You can see that the variance explained by
PC1
andPC2
are: 53.53 and 29.96, respectively, which are very different from the result shown in the above figure.score plot using ggplot2