Impractically long running time PCA command in R RStudio I am using R in RStudio on OS X ver. 10.9.2 on 1.7 GHz Intel Core i7 with 8 GB RAM. I am trying to run a PCA command (prcomp) and plots on a dataset with approximately 200,000 rows and 8 columns. The prompt doesn't return, and most plots don't display (they do work on small ~300 rows datasets).
Am I using the wrong tools for the job (R, hardware)?
Am I doing something else wrong?
Any good suggestions?
 A: I guess the problem might be on the plot part if you're trying somewhere to plot the 200K points, but 200K rows with 8 variables are not a big amount of data at all to perform PCA with that machine setup. 
look at this example:
n<-200000
v1<-rnorm(n,0,1)
v2<-rnorm(n,1,2)
v3<-rnorm(n,2,2)
v4<-rnorm(n,3,2)
v5<-rnorm(n,4,2)
v6<-rnorm(n,5,3)
v7<-rnorm(n,6,4)
v8<-rnorm(n,7,5)

D<-cbind(v1,v2,v3,v4,v5,v6,v7)

system.time(pr_example<-prcomp(D))
#user  system elapsed 
#0.72    0.05    1.21 
summary(pr_example)

A: Regarding slow plotting, try outputting the plots directly to a png file (see the help for the png function if you're unfamiliar with how to do this) rather than visualizing them in RStudio. You'll find this is much faster when producing scatter plots with a large number of points.
A: PCA for your data schold just do eigendecomposition of the 8x8 covariance matrix which is no big deal for normal computers. Thus, it is likely the plotting that takes time, as pointed out by other posts. If your computer has a decent graphics card, you can try the software visumap that allows you to do PCA and interactively explore (scaling and rotating) data cloud with millions of data points.
A: As you can see from the definition of SVD (which is effectively what prcomp is doing):
http://en.wikipedia.org/wiki/Singular_value_decomposition
You are trying to calculate the eigenvectors of M %*% t(M).  This scales cubicly with the number of rows of M, i.e., increasing your data set from from 100k to 200k rows will increase the running time of the prcomp call by 8 times.
Do you really want all 200k components?  With only eight columns I suspect not.  Try: 
svd(M, nu=8)
