Package 'addPmData'

Title: Add PM Estimates to Geocoded Data Based on H3 Geohash
Description: The addPmData package converts latitude and longitude to h3 geohash, and downloads data from an online repository based on that geohash. Data is stored as "chunk" files based on h3 geohash and year to prevent the user from downloading large amounts of unneeded data. Daily PM data is then joined to the user's input data based on geohash and date.
Authors: Erika Rasnick [aut, cre], Cole Brokamp [aut]
Maintainer: Erika Rasnick <[email protected]>
License: GPL (>= 3)
Version: 0.1.1
Built: 2024-11-01 04:24:49 UTC
Source: https://github.com/geomarker-io/addPmData

Help Index


add PM2.5 concentrations to geocoded data based on h3 geohash or lat/lon coords

Description

add PM2.5 concentrations to geocoded data based on h3 geohash or lat/lon coords

Usage

add_pm(d, type = "coords", verbose = FALSE, ...)

Arguments

d

dataframe with columns called "lat", "lon", "start_date" and "end_date"

type

either "coords" (if d contains lat/lon) or "h3" (if d contains resolution 8 h3 ids)

verbose

if TRUE a statement is printed to the console telling the user which chunk file is currently being processed. Defaults to FALSE.

...

arguments passed to s3_get_files

Value

the input dataframe, expanded to include one row per day between the given "start_date" and "end_date", with appended columns for h3_3 (resolution 3), h3 (resolution 8), year, pm_pred, and pm_se.

Examples

d <- tibble::tribble(
  ~id, ~lat, ~lon, ~start_date, ~end_date,
  "55000100280", 39.2, -84.6, "2008-09-09", "2008-09-11",
  "55000100281", 39.2, -84.6, "2007-08-05", "2007-08-08",
  "55000100282", 39.2, -84.6, "2015-08-31", "2015-09-02"
)

add_pm(d)