pan><span class="op">(</span><span class="va">reps</span><span class="op">/</span><span class="fl">5</span><span class="op">)</span></span>
<span><span class="op">}</span></span></code></pre></div>
<pre><code><span><span class="co">##    user  system elapsed </span></span>
<span><span class="co">##  0.0505  0.0010  0.0515</span></span></code></pre>
<p>Using <code><a href="https://r-spatial.github.io/s2/reference/s2_closest_feature.html" class="external-link">s2::s2_dwithin_matrix()</a></code> requires a sec