1
votes

I ran a pca on a set of 45000 genes on 5 different samples, and when I perform a biplot, all I see is a mass of text (responding to the observation names), and cannot see the location of my samples. Is there a way to plot the location of the samples only, and not the observation, in a biplot?

Using built in data from R

usa <- USArrests
pca1 <- prcomp(usa)
biplot(pca1)

Imgur

This generates a biplot where all the states (observation names) overlap the variables (my different samples) rape, etc. Is it possible to plot only the variables (samples), and not the states (observation names)?

1

1 Answers

4
votes

biplot.default uses text to write the categorical variable name of the observation. As it doesn't use points you need to modify the source if you only want the points (and not the labels) to be plotted.

However, you could "hack" it by doing something like:

biplot(pca1, xlabs = rep(".", nrow(usa)))

Imgur

I hope this is what you're looking for!

Edit If this is not satisfactory, you can modify the source given when running stats:::biplot.default to use points.