title: How to calculate correlation In R
body: <p>I wanted to calculate correlation coeficient between colunms of a subset of a data set x in R 
  I have rows of 40 models each 200 simulations in total 8000 rows
  I wanted to calculate the corr coeficient between colums for each simulation (40 rows) </p>
  
  <p><code>cor(x[c(3,5)])</code> calculates from all 8000 rows<br>
  I need <code>cor(x[c(3,5)])</code> but only when <code>X$nsimul=1</code> and so on  </p>
  
  <p>would you help me in this regards
  San</p>