title: What is the fastest way to calculate first two principal components in R?
body: <p>I am using <code>princomp</code> in R to perform PCA. My data matrix is huge (10K x 10K with each value up to 4 decimal points).  It takes ~3.5 hours and ~6.5 GB of Physical memory on a Xeon 2.27 GHz processor.</p>
  
  <p>Since I only want the first two components, is there a faster way to do this?</p>
  
  <p><strong>Update :</strong></p>
  
  <p>In addition to speed, Is there a memory efficient way to do this ? </p>
  
  <p>It takes ~2 hours and ~6.3 GB of physical memory for calculating first two components using <code>svd(,2,)</code>. </p>