title: How to reverse PCA in prcomp to get original data
body: <p>I want to reverse the PCA calculated from prcomp to get back to my original data.</p>
  
  <p>I thought something like the following would work:</p>
  
  <pre><code>pca$x %*% t(pca$rotation)
  </code></pre>
  
  <p>but it doesn't.</p>
  
  <p>The following link shows how to get back the original data from PCs, but explains it only for PCA using eigen on the covariance matrix
  <a href="http://www.di.fc.ul.pt/~jpn/r/pca/pca.html" rel="noreferrer">http://www.di.fc.ul.pt/~jpn/r/pca/pca.html</a></p>
  
  <p>prcomp doesn't calcluate PCs that way.</p>
  
  <p>"The calculation is done by a singular value decomposition of the (centered and possibly scaled) data matrix, not by using eigen on the covariance matrix." -prcomp</p>