data(RKI_Corona_counties)
# German counties (Source: Robert Koch Institute)
Corona_nbstat <-
nbstat (
RKI_Corona_counties,
ID_col="AGS",
link_data = RKI_Corona_counties,
data_ID_col = "AGS",
data_col = "EWZ",
func = "sum"
)
Corona_nbstat$nbmat_data_aggregate
# Sum of population (EWZ) of neighbouring counties
Run the code above in your browser using DataLab