<code>while</code> loop. The <code>while</code> loop is used when you want to keep looping until a specific logical condition is satisfied (contrast this with the <code>for</code> loop which will always iterate through an entire sequence).</p>
<p>The basic structure of the while loop is:</p>
<div class="sourceCode" id="cb405"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb405-1"><a href="loops.html#cb405-1" tabindex="-1"></a><span class="cf">while</span>(logical_condition){ expression }</s