6.13 Performing PCA

We perform PCA on our genotype matrix with prcomp.

pca <- prcomp(gt_matrix_T)

Our output is a prcomp object. This object comprises several tables, which you can preview by typing pca$ into the console and seeing what R suggests:

  • sdev: standard deviations of the principle components
  • rotation, center, scale: tables we won’t use in this lab
  • x: coordinates of the data objects (the 1000 Genomes individuals) on each PC