title: How to iterate over columns with Sapply for Pearson coefficient
body: <p>[i] indicates where I have to iterate pearsons coefficient over the columns and how to convert this into a dataframe attached onto a variable?</p>
  
  <p>Code example:</p>
  
  <pre><code>*INSTEAD OF DOING THIS*
  F.ReedBunting.pear&lt;- cor.test(W_farmland_mean$Years,W_farmland_mean$ReedBunting,method='pearson')
  F.Whitethroat.pear&lt;- cor.test(W_farmland_mean$Years,W_farmland_mean$Whitethroat,method='pearson')
  F.Rook.pear&lt;- cor.test(W_farmland_mean$Years,W_farmland_mean$Rook,method='pearson')
  .
  .
  .
  *HOW CAN IT BE DONE QUICKLY WITH THIS*
  workspaceone &lt;- sapply(W_farmland_mean, function(x){
      cor.test(W_farmland_mean$Years, W_farmland_mean[, 1[i]], method = 'pearson')
  })
  
  </code></pre>