R: How to increment the incrementing variable within a for loop?
<p>I'm trying to manually increment the <em>i</em> variable when a condition is met.</p>

<pre><code>for(i in 1:x){
   if(condition){
      i &lt;- i + 2
      }
   }
</code></pre>

<p>When debugging, the (i&lt;-i+2) line is definitely being run, but i still only increments by 1, instead of 3. (+2 from the line and an additional +1 from the auto increment)</p>

<p>How can I increment while I'm within the loop?</p>