Description Usage Arguments Author(s) See Also Examples
Write a neighbours list as a GAL lattice file, may also use newer GeoDa header format
1 | write.nb.gal(nb, file, oldstyle=TRUE, shpfile=NULL, ind=NULL)
|
nb |
an object of class |
file |
name of file with GAL lattice data |
oldstyle |
if TRUE, first line of file contains only number of spatial units, if FALSE, uses newer GeoDa style |
shpfile |
Shapefile name taken from GAL file for this dataset |
ind |
region id indicator variable name |
Roger Bivand Roger.Bivand@nhh.no
1 2 3 4 5 | example(columbus)
GALfile <- tempfile("GAL")
write.nb.gal(col.gal.nb, GALfile)
col.queen <- read.gal(GALfile)
summary(diffnb(col.queen, col.gal.nb))
|
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
Neighbour list object:
Number of regions: 49
Number of nonzero links: 0
Percentage nonzero weights: 0
Average number of links: 0
49 regions with no links:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Link number distribution:
0
49
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.