SF neighbour connector

RStudio addin to quickly add manual connections to spdep::poly2nb() neighbour lists based on an sf object in your current R environment.

[!WARNING] This add-in was mostly vibe-coded because I needed it myself. Use at your own risk.

Installation

You can install the development version of {sfneighbourconnector} like so:

# remotes::install_github("vankesteren/sfneighbourconnector")
install.packages("sfneighbourconnector", repos = c('https://vankesteren.r-universe.dev', 'https://cloud.r-project.org'))

Then, restart your RStudio. The add-in should now be available in the addins dropdown.

Example

library(sf)
my_sf <- st_read("https://nlgis.nl/api/maps?year=1869")

Then select the add-in. Be patient, initial loading can take some time!

screenshot

User manual