I have performed a PCA and drawn a biplot in R
.
pca1= princomp (~ data$X250 + data$X500 + data$shear, scores=TRUE, cor=TRUE, rownames=data[,1])
biplot(pca1, xlab="PC 1", ylab="PC 2", pch=20)
Currently the labels on the biplot are the row numbers, but I would like the point labels to be the plot names of my data. My data has 81 rows.
I have tried:
text (pca1[1:81], pca1[1:81], labels = row.names(data))
text (1:81, 1:81, labels = row.names(data))
text (pca1$comp.1[1:81], pca1$comp.2[1:81], labels = row.names(data))
Try giving
rownames(data)<-data[,1]
before using princomp