I want to reverse the PCA calculated from prcomp to get back to my original data.
I thought something like the following would work:
pca$x %*% t(pcal$rotation)
prcomp will center the variables so you need to add the subtracted means back
t(t(pca$x %*% t(pca$rotation)) + pca$center)
TRUE you will also need to re-scale
t(t(pca$x %*% t(pca$rotation)) * pca$scale + pca$center)