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

read.gra

Read Geographical Information in Graph Format


Description

Reads the geographical information provided in a file in graph format (see Ch. 5 of the BayesX Reference Manual) and stores it in a map object.

Usage

read.gra(file, sorted=FALSE)

Arguments

file

Name of the graph file to be read.

sorted

Should the regions be ordered by the numbers speciying the region names (sorted=TRUE)?

Value

Returns an adjacency matrix that represents the neighborhood structure defined in the graph file. Additional attributes are

dim

Dimension of the (square) adjacency matrix.

dimnames

List of region names corresponding to rows and columns of the adjacency matrix.

class

Indicates whether the map is stored in boundary format (bnd) or graph format (gra). Maps returned by read.gra are of class gra

Author(s)

Thomas Kneib, Felix Heinzl

References

BayesX Reference Manual. Available from http://www.bayesx.org/

See Also

Examples

germany <- read.gra(system.file("examples/germany.gra", package="BayesX"))
attributes(germany)

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.