de></pre>
<pre class="r"><code>as.numeric(rl)</code></pre>
<pre><code>##  [1] 1 1 1 1 2 2 3 3 2 2</code></pre>
<p>Note the accessor functions <code>runLength()</code> and <code>runValue()</code>.</p>
<p>This is a very efficient representation if</p>
<ul>
<li>the vector is very long</li>
<li>there are a lot of consecutive elements with the same value</li>
</ul>
<p>This is especially useful for genomic data which is either piecewise constant, or where most of the genome is not covered (eg. RNA sequencing in m