[Solved] how to color points in 17 colors based on principal component? [closed]


It’s hard to say without knowing exactly what your data look like, but perhaps something like this would work:

cols <- rainbow(17)[as.factor(gtex_pm$tissue)]

plot(pc_gtex$x[,1], pc_gtex$x[,2], col=cols, main = "PCA", xlab = "PC1", ylab = "PC2")

4

solved how to color points in 17 colors based on principal component? [closed]