"cb11-2"><a href="#cb11-2" tabindex="-1"></a>coords <span class="ot">&lt;-</span> <span class="fu">index_to_coord</span>(img, <span class="fu">which</span>(<span class="fu">as.logical</span>(img)))</span>
<span id="cb11-3"><a href="#cb11-3" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">123</span>)</span>
<span id="cb11-4"><a href="#cb11-4" tabindex="-1"></a>k <span class="ot">&lt;-</span> <span class="dv">10</span>  <span class="co"># 10 parcels</span></span>
<span id="cb11-5"><a href=