add_neighbour {bigDM}  R Documentation 
Add isolated areas (polygons) to its nearest neighbour
Description
The function returns a neighbour list of class nb
and its associated spatial adjacency matrix
computed by adding isolated areas to its nearest neighbour (in terms of Euclidean distance between centroids) using the knearneigh
function of 'spdep' package.
Usage
add_neighbour(carto, nb = NULL, plot = FALSE)
Arguments
carto 
object of class 
nb 
optional argument with the neighbour list of class 
plot 
logical value (default 
Value
This function returns a list with the following two elements:

nb
: the modified neighbours's list 
W
: associated spatial adjacency matrix of classCsparseMatrix
Examples
library(spdep)
## Load the Spanish colorectal cancer mortality data ##
data(Carto_SpainMUN)
## Compute the neighbour list from spatial polygons ##
nb_SpainMUN < poly2nb(Carto_SpainMUN)
summary(nb_SpainMUN) # 1 region with no links
## Add isolated area to its nearest neighbour ####
carto.mod < add_neighbour(carto=Carto_SpainMUN, nb=nb_SpainMUN)
summary(carto.mod$nb) # 0 region with no links
[Package bigDM version 0.5.4 Index]