add.neighbor

0th

Percentile

Add Neighborhood Relations

Adds a neighborhhod relationship between two given regions to a map object in graph format.

Keywords
spatial
Usage
add.neighbor(map, region1, region2)
Arguments
map

map object in graph format that should be modified.

region1, region2

character, names of the regions that should be connected as neighbors.

Value

Returns an adjacency matrix that represents the neighborhood structure of map plus the new neighborhood relation in graph format.

See Also

get.neighbor, delete.neighbor, read.gra, write.gra, bnd2gra.

Aliases
  • add.neighbor
Examples
# NOT RUN {
## read the graph file
file <- file.path(find.package("R2BayesX"), "examples", "Germany.gra")
germany <- read.gra(file)

## add some neighbors
get.neighbor(germany, c("1001", "7339"))
germany <- add.neighbor(germany, "7339", "1001")
get.neighbor(germany, c("1001", "7339"))
# }
Documentation reproduced from package R2BayesX, version 1.1-1, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.