add_schwartz_pollutants: add PM2.5, NO2, and O3 concentrations to data based on...

Description Usage Arguments Value Examples

View source: R/add_pollutants.R

Description

add PM2.5, NO2, and O3 concentrations to data based on geohash

Usage

1

Arguments

d

dataframe with columns called 'sitecode', 'start_date', and 'end_date' (most likely the output from the 'schwartz_grid_lookup“ container)

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 geohash, PM2.5, NO2, and O3 concentrations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if (FALSE) {
d <- tibble::tribble(
     ~id,         ~lat,    ~lon, ~site_index,      ~sitecode,  ~start_date,    ~end_date,
     '55000100280', 39.2, -84.6,   '9607238', '211050640897', '2008-09-09', '2008-09-11',
     '55000100281', 39.2, -84.6,   '9607238', '211050640897', '2007-08-05', '2007-08-08',
     '55000100282', 39.2, -84.6,   '9607238', '211050640897', '2015-08-31', '2015-09-02') %>%
   dplyr::mutate_at(vars(start_date, end_date), as.Date)

   add_schwartz_pollutants(d)
}

geomarker-io/schwartzGeohashPM documentation built on July 22, 2021, 1:10 p.m.