BayesX (version 0.2-3)

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

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.grabnd2gra

Examples

Run this code
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"))

Run the code above in your browser using DataLab