Neighbours | R Documentation |
Finding all directly adjacent neighbours of a regional unit is not trivial. For a list of regional units, this function searches for the corresponding Neighbours and returns the results as a list.
Neighbours(map, id = NULL)
map |
the name of the map |
id |
vector of ids for which the Neighbours are to be found. When it's left to |
A list of vectors of ids for the neighbours of each region in the map.
Andri Signorell <andri@signorell.net>
try( {
nbs <- Neighbours(GetMap("kant.map"), kt_id <- 18)
PlotKant(c(kt_id, nbs), col=c("red", rep("green", length(nbs))) )
# works as well for communities and for vector of ids
nbs <- Neighbours(GetMap("polg.map"), polg_id <- c(3851, 3352))
PlotPolg(c(polg_id, unlist(nbs)),
col=c(rep("red", 2), rep("green", length(unlist(nbs)))))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.