View source: R/delete.neighbor.R
delete.neighbor | R Documentation |
Adds the neighborhhod relationship between two given regions from a map object in graph format.
delete.neighbor(map, region1, region2)
map |
map object in graph format that should be modified. |
region1, region2 |
names of the regions that should no longer be regarded as neighbors. |
Returns an adjacency matrix that represents the neighborhood structure of map
minus the
deleted neighborhood relation in graph format.
Felix Heinzl, Thomas Kneib.
get.neighbor
, add.neighbor
, read.gra
,
write.gra
, bnd2gra
.
## read the graph file
file <- file.path(find.package("R2BayesX"), "examples", "Germany.gra")
germany <- read.gra(file)
## delete some neighbors
get.neighbor(germany, c("7339"))
germany <- delete.neighbor(germany, "7339", "7141")
get.neighbor(germany, c("7339"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.