Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add.neighbor

Add Neighborhood Relations


Description

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

Usage

add.neighbor(map, region1, region2)

Arguments

map

Map object in graph format that should be modified.

region1, region2

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.

Author(s)

Felix Heinzl, Thomas Kneib

See Also

Examples

germany <- read.gra(system.file("examples/germany.gra", package="BayesX"))
get.neighbor(germany, c("1001", "7339"))
germany <- add.neighbor(germany, "7339", "1001")
get.neighbor(germany, c("1001", "7339"))

BayesX

R Utilities Accompanying the Software Package BayesX

v0.3-1
GPL-2 | GPL-3
Authors
Nikolaus Umlauf [aut, cre], Thomas Kneib [aut], Nadja Klein [aut], Felix Heinzl [ctb], Andreas Brezger [ctb], Daniel Sabanes Bove [ctb]
Initial release
2019-08-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.