spdep (version 0.1-10)

read.gal: Read a GAL lattice file into a neighbours list

Description

The function reads a GAL lattice file into a neighbours list for spatial analysis.

Usage

read.gal(file, row.names=NULL)

Arguments

file
name of file with GAL lattice data
row.names
character vector of region ids to be added to the neighbours list as attribute region.id, default seq(1, nrow(x))

Value

  • The function returns an object of class nb with a list of integer vectors containing neighbour region number ids.

Details

Luc Anselin (1995): SpaceStat; GAL - Geographical Algorithms Library, University of Newcastle

See Also

summary.nb

Examples

Run this code
data(columbus)
data(columbus)
GALfile <- tempfile("GAL")
write.nb.gal(col.gal.nb, GALfile)
col.queen <- read.gal(GALfile)
unlink(GALfile)
summary(diffnb(col.queen, col.gal.nb))

Run the code above in your browser using DataCamp Workspace