title: Indexing arguments passed to for loop
body: <p>Basically, I would like a for loop that goes from 10:15, then 20:25.
  How would that be possible? My attempt so far was the following (which seems overly complex and doesn't work). I hope that the none working code gives an idea of what I want to achieve.</p>
  
  <pre><code># dummy data set
  V1 &lt;- as.data.frame(rnorm(20, 0, 1))
  
  ## attempt
  i &lt;- c(10, 20)
  j &lt;- c(15, 25)
  a &lt;- 1
  for(a in 1:length(i)) {
  for(i[a] in i[a]:j[a]) {
  ...
  }
  }
  </code></pre>
  
  <p>In words: With the first (outer) for loop, I attempt to index which values of i (start) and j (end) of the respective vector are passed to the second (inner) for loop. So what I would like to have, by that, in the inner for loop would be:</p>
  
  <p>1st:     </p>
  
  <pre><code>for(10 in 10:15) {
  ... }
  </code></pre>
  
  <p>2nd:</p>
  
  <pre><code>for(20 in 20:25) {
  ... }
  </code></pre>