What is the difference between finish and continue in browser()?
<p>In the help file for <code>browser</code>, there are two options that seem very similar:</p>

<p><code>f</code></p>

<blockquote>
  <p>finish execution of the current loop or function</p>
</blockquote>

<p><code>c</code></p>

<blockquote>
  <p>exit the browser and continue execution at the next statement.</p>
</blockquote>

<p>What is the difference between them and in what situations is the difference apparent?</p>

<p>Some clues about what may be the difference - I wrote a script called <code>browse.R</code> with the following contents:</p>

<pre><code>for (i in 1:2){
  browser()
  print(i)
}
</code></pre>

<p>This is the results of using<code>c</code> vs <code>f</code>:</p>

<pre><code>&gt; source("browse.R")
Called from: eval(expr, envir, enclos)
Browse[1]&gt; c
[1] 1
Called from: eval(expr, envir, enclos)
Browse[1]&gt; c
[1] 2
&gt; source("browse.R")
Called from: eval(expr, envir, enclos)
Browse[1]&gt; f
[1] 1
Browse[2]&gt; f
[1] 2
</code></pre>

<p>Note that the level of <code>Browse[n]</code> changes. This still doesn't highlight any practical difference between them.</p>

<p>I also tried to see if perhaps things would disappear from the browser environment:</p>

<pre><code>for (i in 1:2){
  a &lt;- "not modified"
  browser()
  print(a)
}

Called from: top level 
Browse[1]&gt; a &lt;- "modified"
Browse[1]&gt; f
[1] "modified"
Browse[1]&gt; a
[1] "not modified"
Browse[1]&gt; a &lt;- "modified"
Browse[1]&gt; c
[1] "modified"
</code></pre>

<p>So there's no difference there either.</p>