| nbstat | R Documentation |
Calculating descriptive neighbourhood statistics based on regions (polygons) with contiguous boundaries from an object of class nbmatrix
nbstat(
object,
link_data,
ID_col,
data_col,
func = "sum",
verbose = FALSE
)
object |
|
link_data |
|
ID_col |
Column with unique ID of each polygon feature in the link_data |
data_col |
Column with regarded numeric values in |
func |
Descriptive statistic ( |
verbose |
|
Calculates a specified statistic (e.g., mean or sum) for the neighboring regions within a nbmatrix object.
The user must specify a (spatial) data frame with the parameter link_data.
The results are saved in the nbmatrix object.
If func is set to NULL, nbstat is used to specify the data column used for further analyses (e.g., moran()).
object of class nbmatrix-class
Thomas Wieland
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")}
nbmatrix, moran, getisord, gstar
data(RKI_Corona_counties)
# German counties (Source: Robert Koch Institute)
Corona_nbmat <-
nbmatrix (
RKI_Corona_counties,
ID_col="AGS",
verbose = TRUE
)
# Creating neighborhood matrix
Corona_nbstat <- nbstat(
Corona_nbmat,
link_data = RKI_Corona_counties,
ID_col = "AGS",
data_col = "EWZ",
func = "sum",
verbose = TRUE
)
# Sum of population (EWZ) of neighboring counties
plot(
Corona_nbstat,
main = "No. of inhabitants"
)
# Plot simple map of "EWZ"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.