我只需将这些图形放在同一个图形上,第一个图形的点需要与第二个图形不同。我觉得这很容易,但我找不到请帮忙。谢谢
library(ggfortify)
myPCA <- prcomp(iris[-5])
# drawing PC1 and PC2
autoplot(myPCA)
# drawing PC3 and PC4
myPCAtrunc <- myPCA
myPCAtrunc[[1]] <- myPCAtrunc[[1]][c(3,4,1,2)]
myPCAtrunc[[2]] <- myPCAtrunc[[2]][,c(3,4,1,2)]
colnames(myPCAtrunc[[2]]) <- c("PC1","PC2","PC3","PC4") # fake names
myPCAtrunc[[5]] <- myPCAtrunc[[5]][,c(3,4,1,2)]
colnames(myPCAtrunc[[5]]) <- c("PC1","PC2","PC3","PC4") # fake names
autoplot(myPCAtrunc, xlab = "PC3", ylab="PC4")