write.nb.gal.Rd
Write a neighbours list as a GAL lattice file, may also use newer GeoDa header format
write.nb.gal(nb, file, oldstyle=TRUE, shpfile=NULL, ind=NULL)
an object of class nb
with a list of integer vectors containing neighbour region number ids.
name of file with GAL lattice data
if TRUE, first line of file contains only number of spatial units, if FALSE, uses newer GeoDa style
Shapefile name taken from GAL file for this dataset
region id indicator variable name
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
GALfile <- tempfile("GAL")
write.nb.gal(col.gal.nb, GALfile)
col.queen <- read.gal(GALfile)
summary(diffnb(col.queen, col.gal.nb))
#> 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