title: correlation matrix using large data sets in R when ff matrix memory allocation is not enough
body: <p>I have a simple analysis to be done. I just need to calculate the correlation of the columns (or rows ,if transposed). Simple enough? I am unable to get the results for the whole week and I have looked through most of the solutions here. </p>
  
  <p>My laptop has a 4GB RAM. I do have access to a server with 32 nodes. My data cannot be loaded here as it is huge (411k columns and 100 rows). If you need any other information or maybe part of the data I can try to put it up here, but the problem can be easily explained without really having to see the data. I simply need to get a correlation matrix of size 411k X 411k which means I need to compute the correlation among the rows of my data.</p>
  
  <p>Concepts I have tried to code: (all of them in some way give me memory issues or run forever)</p>
  
  <ol>
  <li>The most simple way, one row against all, write the result out using append.T. (Runs forever) </li>
  <li>biCorPar.r by bobthecat (<a href="https://gist.github.com/bobthecat/5024079" rel="nofollow">https://gist.github.com/bobthecat/5024079</a>), splitting the data into blocks and using ff matrix. (unable to allocate memory to assign the corMAT matrix using ff() in my server)</li>
  <li>split the data into sets (every 10000 continuous rows will be a set) and do correlation of each set against the other (same logic as bigcorPar) but I am unable to find a way to store them all together finally to generate the final 411kX411k matrix.</li>
  <li>I am attempting this now, bigcorPar.r on 10000 rows against 411k (so 10000 is divided into blocks) and save the results in separate csv files.</li>
  <li>I am also attempting to run every 1000 vs 411k in one node in my server and today is my 3rd day and I am still on row 71. </li>
  </ol>
  
  <p>I am not an R pro so I could attempt only this much. Either my codes run forever or I do not have enough memory to store the results. Are there any more efficient ways to tackle this issue?</p>
  
  <p>Thanks for all your comments and help. </p>