Difficulty with poly2nb() and nb2mat() in spdep package

I would appreciate some advice on making a spatial weights matrix using the spdep() package. (1) If I have spatial data download from the rnaturalearth package, and a list of countries in another dataset, what is an efficient way to subset the data. To be specific I have: library(rnaturalearth) ne_sf <- ne_countries(returnclass = "sf") And… Read More Difficulty with poly2nb() and nb2mat() in spdep package