This function converts a graph with islands into a fully connected graph by searching for the nearest area between the different nodes and connecting them, with the possibility of setting a threshold for connecting several areas if they are within the limits.
Usage
inla.full.graph(
sp_obj,
graph,
thresh = 0.1,
snap = 5e-07,
distance_by = c("perimeter", "centroid")
)