title: Running cor() (or any variant) over a sparse matrix in R
body: <p>When trying to run the <code>cor()</code> function on sparse matrices (of either type dgCMatrix or dgTMatrix) I get the following error:</p>
  
  <pre><code>Error in cor(x) : supply both 'x' and 'y' or a matrix-like 'x'
  </code></pre>
  
  <p>Converting my matrix to be dense will be very inefficient.
  Is there an easy way to calculate this correlation (without an all pairs loop?).</p>
  
  <p>Thanks,</p>
  
  <ul>
  <li>Ron</li>
  </ul>