タ（2020年度）」を加工して作成。</p>
</div>
<div class="section level3">
<h3 id="spdepknn2nb-and-localmoran">
<code>spdep::knn2nb()</code> and <code>localmoran()</code><a class="anchor" aria-label="anchor" href="#spdepknn2nb-and-localmoran"></a>
</h3>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">coords1</span> <span class="op">&lt;-</span> <span class="fu">sf</span><span class="fu">::</span><span class="fu"><a href="http