ex&quot;)
#&gt; [1] 100000000
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;booltype&quot; &quot;which&quot;
</code></pre>

<p>for filtered chunked looping </p>

<pre><code class="r">lapply(chunk(from=1, to=n, length=10), function(i)as.which(b1, range=i))
#&gt; $`1:10000000`
#&gt;  [1] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#&gt; attr(,&quot;maxindex&quot;)
#&gt; [1] 100000000
#&gt; attr(,&quot;class&quot;)
#&gt; [1] &quot;booltype&quot; &quot;which&quot;   
#&gt; 
#&gt; $`10000001: