"#cb11-5" tabindex="-1"></a><span class="cf">if</span> (<span class="fu">nrow</span>(coords) <span class="sc">&gt;</span> k) {</span>
<span id="cb11-6"><a href="#cb11-6" tabindex="-1"></a>  km <span class="ot">&lt;-</span> <span class="fu">kmeans</span>(coords, <span class="at">centers =</span> k, <span class="at">iter.max =</span> <span class="dv">100</span>)</span>
<span id="cb11-7"><a href="#cb11-7" tabindex="-1"></a>  </span>
<span id="cb11-8"><a href="#cb11-8" tabindex="-1"></a>  <span class="co"># Cre