create a neighbourhood network from touching regions in a shapefile, with additional capability to connect non touching areas where there may be bridges etc.

createNeighbourNetwork(
  shape,
  idVar = "code",
  bridges = arear::ukconnections,
  queen = FALSE,
  ...
)

Arguments

shape

- a sf object, if not present will be loaded from cache

idVar

- the column containing the coded identifier of the map

bridges

- a df with the following columns: name start.lat start.long end.lat end.long defining connections between non touching shapes (e.g. bridges / ferries / etc.)

queen

- include neighbouring areas that only touch at corners, defaults to false.

...

- passed on to .cached() (cache control) - relevant is nocache = TRUE which prevents this from being precalculated

Value

an edge list of ids with from and to columns