The function prints summary measures for links in a neighbours list. If a matrix of coordinates is given as well, summary descriptive measures for the link lengths are also printed. Print and summary functions are also available for "listw" weights list objects, also reporting constants (S0, S1, S2) used in inference for global spatial autocorrelation statistics such as Moran's I, Geary's C, join-count tests and Getis-Ord G.

# S3 method for nb
summary(object, coords=NULL, longlat = NULL, scale = 1, ...)
# S3 method for nb
print(x, ...)
# S3 method for listw
summary(object, coords, longlat, zero.policy = NULL,
 scale = 1, ...)
# S3 method for listw
print(x, zero.policy = NULL, ...)

Arguments

object

an object of class nb

coords

matrix of region point coordinates or a SpatialPoints object or an sfc points object

longlat

TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers; if coords is a SpatialPoints object, the value is taken from the object itself

...

additional arguments affecting the output produced

x

an object of class nb

zero.policy

default NULL, use global option value; if FALSE stop with error for any empty neighbour sets

scale

passed through to stem() for control of plot length

Author

Roger Bivand Roger.Bivand@nhh.no

See also

Examples

columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1], quiet=TRUE)
col.gal.nb <- read.gal(system.file("weights/columbus.gal", package="spData")[1])
coords <- st_centroid(st_geometry(columbus), of_largest_polygon=TRUE)
col.gal.nb
#> Neighbour list object:
#> Number of regions: 49 
#> Number of nonzero links: 230 
#> Percentage nonzero weights: 9.579342 
#> Average number of links: 4.693878 
summary(col.gal.nb, coords)
#> Neighbour list object:
#> Number of regions: 49 
#> Number of nonzero links: 230 
#> Percentage nonzero weights: 9.579342 
#> Average number of links: 4.693878 
#> Link number distribution:
#> 
#>  2  3  4  5  6  7  8  9 10 
#>  7  7 13  4  9  6  1  1  1 
#> 7 least connected regions:
#> 1 6 31 39 42 46 47 with 2 links
#> 1 most connected region:
#> 20 with 10 links
#> Summary of link distances:
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>  0.1276  0.3613  0.4566  0.4694  0.5536  0.8924 
#> 
#>   The decimal point is 1 digit(s) to the left of the |
#> 
#>   1 | 3344
#>   1 | 99
#>   2 | 000011333344
#>   2 | 556677779999
#>   3 | 000011222222223344444444
#>   3 | 556666777777888888889999999999
#>   4 | 00001111112233333333334444
#>   4 | 55666666666666777777777788888899
#>   5 | 0011112222222222222233334444
#>   5 | 556666667788
#>   6 | 000000112244
#>   6 | 5577889999
#>   7 | 11112244
#>   7 | 557777
#>   8 | 1144
#>   8 | 55999999
#> 
col.listw <- nb2listw(col.gal.nb, style="W")
col.listw
#> Characteristics of weights list object:
#> Neighbour list object:
#> Number of regions: 49 
#> Number of nonzero links: 230 
#> Percentage nonzero weights: 9.579342 
#> Average number of links: 4.693878 
#> 
#> Weights style: W 
#> Weights constants summary:
#>    n   nn S0       S1       S2
#> W 49 2401 49 23.48489 204.6687
summary(col.listw)
#> Characteristics of weights list object:
#> Neighbour list object:
#> Number of regions: 49 
#> Number of nonzero links: 230 
#> Percentage nonzero weights: 9.579342 
#> Average number of links: 4.693878 
#> Link number distribution:
#> 
#>  2  3  4  5  6  7  8  9 10 
#>  7  7 13  4  9  6  1  1  1 
#> 7 least connected regions:
#> 1 6 31 39 42 46 47 with 2 links
#> 1 most connected region:
#> 20 with 10 links
#> 
#> Weights style: W 
#> Weights constants summary:
#>    n   nn S0       S1       S2
#> W 49 2401 49 23.48489 204.6687