nbrs_max: Add maximum observation of neighbors values to SF object

View source: R/nbrvalues.R

nbrs_maxR Documentation

Add maximum observation of neighbors values to SF object

Description

Add maximum observation of neighbors values to SF object

Usage

nbrs_max(sf_object, unique_id_col, date_col, variable)

Arguments

sf_object

An object of class 'SF'

unique_id_col

A string identifying a unique column to serve as an identifier

date_col

(Optional) A string identifying a variable for date, use if data is over multiple time periods.

variable

A string identifying a numeric variable

Value

Column string of neighbors

Examples

panel_example_sf <- nbrs_max(sf_object = panel_example_sf, unique_id_col = "country", variable = "gdp", date_col="year")
panel_example_sf <- nbrs_max(panel_example_sf, "country", "gdp", "year")
cross_section_example_sf <- nbrs_max(sf_object = cross_section_example_sf, unique_id_col = "country", variable = "gdp")
cross_section_example_sf <- nbrs_max(cross_section_example_sf, "country", "gdp")

nbrvalues/nbrvalues documentation built on March 4, 2024, 5:04 p.m.