Hi there,
I am trying to plot the PCA of a transposed MS feature matrix using the following code
tp<- as.factor(xdata_group_fill$timepoint)
tfmat<-pca(t(fmat), center=TRUE, scale=TRUE)
plotIndiv(tfmat,
comp = c(1, 2), # Specify components to plot
ind.names = T, # Show row names of samples
group = tp,
col.per.group = timepoint_colors, # Use the colors defined for each timepoint
ellipse = TRUE,
title = ‘ABC transporters, PCA comp 1 - 2’,
legend = TRUE,
legend.title = ‘Timepoint’)
If i set ind.names=T the plot is correct (left image). As you can see the ellipses are correctly matched with the samples. Now if I set ind.names= F, i get incorrect matching (right image) where there seems to be a swap in point colors and ellipse end up wrongly matched…
Do you have any clue what causes this error and how I could solve it? Appreciate any help!
Kind regards,
Timothy