title: Refering to columns of a dataframe that have almost the same name inside a loop in r
body: <p>I am just a beginner in R and I am working with the following very simple setting. My data-frame has 10 variables labeled as x.1,x.2,...,x.10, and 100 observations.</p>
  <p>I need to run a loop over these variables and observations like this</p>
  <pre><code>   T&lt;- 10
     N &lt;- 100 
  for(j in 1:T){
  for(i in 1:N){
  df1$x.j[*some condition over i*] = def2$y[*some condition over i*]
  }
  }
  </code></pre>
  <p>The only thing I need to know is how to make R understand that when <code>j = 2</code> (say) in this loop, <code>df1$x.j = df1$x.2</code> and so on until <code>T=10</code>.</p>
  <p>Thanks in advance.</p>