0

I am using the following example to test my data in pca.

I was hoping to extract the data points used to plot PCA scatter chart with ggbiplot function. I couldnt find anything in ggbiplot documentation, but maybe someone is aware of an alternative ?

Thank you

nlv
  • 791
  • 7
  • 28
  • the PCs are in `ir.pca$rotation` `str` is your friend in these cases to inspect what is in a object. – emilliman5 Nov 23 '16 at 16:57
  • @emilliman5 thanks for suggestion, as you recommended I have used rotation command and this is my output [here](https://img42.com/ERSfm). Could you please comment on it ? As far as I understand I see the vector values but not the x&y for the end scatter chat. – nlv Nov 24 '16 at 08:08
  • The x and y are PC1 and PC2 in this case. Normally, PCA the first few components are the ones we care about since they capture the mist variation – emilliman5 Nov 24 '16 at 16:01
  • @emilliman5 understood, but if thats the case, why is the function (ir.pca$rotation) only returning 4 points in the plot ? There are quite a few points in the scatter chart in the end result... – nlv Nov 24 '16 at 16:07

1 Answers1

0

The ir.pca object has several properties, and one of them is "x", which had all the points I was looking for.

This was what led me to an answer.

nlv
  • 791
  • 7
  • 28