nbmatrix-class: Class '"nbmatrix"'

nbmatrix-classR Documentation

Class "nbmatrix"

Description

The class "nbmatrix" contains the results of a neighborhood matrix analysis, built by the nbmatrix function and the "nbmatrix" methods. Use summary(nbmatrix) and plot(nbmatrix) for results summary and plotting, respectively.

Objects from the Class

Objects may be created by the function nbmatrix.

Slots

nb

Object of class "nb": Neighborhood matrix list generated by spdep::poly2nb

nbmat

Object of class "data.frame": Linear neighborhood matrix calculated from the nb list

weights

Object of class "listw": Spatial weights generated by spdep::nb2listw

nbcount

Object of class "data.frame": Table with the number of neighbors

regions_col_name

Object of class "character": Column name which represents the unique ID of the polygon features

geodata

Object of class "sf": Original geodata (sf object) with unique ID and "geometry" columns

N

Object of class "numeric": No. of features (total, with valid unique ID, with valid geometry)

N_neighbors

Object of class "numeric": Total and average no. of neighbors

polygon_data

Object of class "sf": Geodata (sf object containing the geometries and the analysis column)

nbmat_data

Object of class "data.frame": Neighborhood matrix data

nbmat_data_aggregate

Object of class "data.frame": Aggregated neighborhood matrix data

func

Object of class "character": Function used for the calculation of the neighborhood statistic

moran

Object of class "list": Results of the Global Moran's I calculation (estimate, expected value, etc.)

getisord

Object of class "list": Results of the Global Getis-Ord calculation (estimate, expected value, etc.)

gstar

Object of class "list": Results of the Local Gi* calculation (data.frame with estimates and expected values etc., analysis configuration)

data_col

Object of class "character": Column name which represents the analysis data for nbstat, Moran's I, etc.

config

Object of class "list": Configuration details with respect to zero policy of the neighborhood matrix etc.

timestamp

Object of class "list": Time stamps of any update of the instance

Methods

nbstat

signature(object = "nbmatrix"): Calculates a specified statistic for the neighboring regions.

moran

signature(object = "nbmatrix"): Calculates the Global Moran's I statistic for the neighborhood matrix

getisord

signature(object = "nbmatrix"): Calculates the Global Getis-Ord statistic for the neighborhood matrix

gstar

signature(object = "nbmatrix"): Calculates the Local Getis-Ord Gi* statistic for the neighborhood matrix

plot

signature(x = "nbmatrix"): Plots the results of the calculation (Neighborhood statistic or Local Getis-Ord Gi*)

print

signature(x = "nbmatrix"): Prints an nbmatrix object; use summary(nbmatrix) for results

show

signature(object = "nbmatrix"): Prints an nbmatrix object; use summary(nbmatrix) for results

summary

signature(object = "nbmatrix"): Prints a summary of nbmatrix objects (results of the spatial statistics calculation)

Author(s)

Thomas Wieland

References

Cliff AD, Ord JK (1981) Spatial Processes: Models & Applications. https://archive.org/details/spatialprocesses0000clif

GeoDa Center (2026) GeoDa. An Introduction to Spatial Data Science. https://geodacenter.github.io/

Wieland T (2020) Flatten the Curve! Modeling SARS-CoV-2/COVID-19 Growth in Germany at the County Level. REGION 7(2), 43–83. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.18335/region.v7i2.324")}

Wieland T (2022) Spatial patterns of excess mortality in the first year of the COVID-19 pandemic in Germany. European Journal of Geography 13(4), 18-33. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.48088/ejg.t.wie.13.4.018.033")}

See Also

nbstat, moran, getisord, gstar, nbmatrix

Examples

showClass("nbmatrix")

swash documentation built on Oct. 18, 2026, 5:06 p.m.