pan></code></pre></div>
<p>A simple example of a while loop is:</p>
<div class="sourceCode" id="cb406"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb406-1"><a href="loops.html#cb406-1" tabindex="-1"></a>i <span class="ot">&lt;-</span> <span class="dv">0</span></span>
<span id="cb406-2"><a href="loops.html#cb406-2" tabindex="-1"></a><span class="cf">while</span> (i <span class="sc">&lt;=</span> <span class="dv">4</span>) {</span>
<span id="cb406-3"><a href="loops.html#cb406-3" tabindex="-1