index_populated_grid_cells: Get populated grid cells by location

Description Usage Arguments Value

View source: R/spatial_data_functions.R

Description

Pull the latitude, longitude, and population for each grid cell associated with each location in a shapefile

Usage

1
index_populated_grid_cells(pop, polys_sf, loc_field)

Arguments

pop

Population rasterLayer (representing a single year)

polys_sf

sf object representing polygons, with a field that has a unique identifier for each location

loc_field

Location identifier field in the polygons sf object

Value

A data.table containing four columns, where each row represents a grid cell: - <loc_field>: The location identifier - pop: Population - lat: Latitude - lon: Longitude


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.