nb2INLA: Output spatial neighbours for INLA

Description Usage Arguments Value Author(s) References Examples

View source: R/read.gwt2nb.R

Description

Output spatial neighbours for INLA

Usage

1

Arguments

file

file where adjacency matrix will be stored

nb

an object of class nb

Value

Nothing is returned but a file will be created with the representation of the adjacency matrix as required by INLA for its spatial models.

Author(s)

Virgilio Gomez-Rubio

References

http://www.r-inla.org

Examples

1
2
3
example(columbus)
td <- tempdir()
x <- nb2INLA(paste(td, "columbus-INLA.adj", sep="/"), col.gal.nb)

Example output

Loading required package: sp
Loading required package: Matrix

colmbs> require(maptools)
Loading required package: maptools
Checking rgeos availability: TRUE

colmbs> columbus <- readShapePoly(system.file("etc/shapes/columbus.shp",
colmbs+  package="spdep")[1])

colmbs> col.gal.nb <- read.gal(system.file("etc/weights/columbus.gal",
colmbs+  package="spdep")[1])
Warning message:
use rgdal::readOGR or sf::st_read 

spdep documentation built on Aug. 19, 2017, 3:01 a.m.