title: Lm across many columns in a dataframe in R
body: <p>I have a dataframe with many numerical columns, The first col need to be regressed against the second column, then store the Rsqr value, then the first column against the thrid column , then stores the Rsqr value...and so on. Do this until the nth column has been regressed to the 1st column.</p>
  
  <p>Id like the result to be a dataframe that houses the Rsqr values for colnames regressed.</p>
  
  <p>ie</p>
  
  <pre><code>tested              rqr
  col1 v col2         0.56
  col1 v col3         0.28
  col1 v col4         0.38
  </code></pre>
  
  <p>I know I havn't supplied data - i'm looking for the approach. I had been using a lm function called within a forloop to do this, but it takes very long. I'm wondering if theres an apply solution to this.</p>
  
  <p>paul</p>