Assemble a tibble of required predictors for the exposure assessment model
Source:R/assemble.R
assemble_predictors.Rd
Assemble a tibble of required predictors for the exposure assessment model
Usage
assemble_predictors(x, dates, pollutant = c("pm25"))
Arguments
- x
a vector of s2 cell identifers (
s2_cell
object); currently required to be within the contiguous united states- dates
a list of date vectors for the predictions, must be the same length as
x
- pollutant
ignored now, but reserved for future sets of predictors specific to different pollutants
Value
a tibble with one row for each unique s2 location - date combination where columns are predictors required for the exposure assessment model
Examples
d <- list(
"8841b39a7c46e25f" = as.Date(c("2023-05-18", "2023-11-06")),
"8841a45555555555" = as.Date(c("2023-06-22", "2023-08-15"))
)
assemble_predictors(x = s2::as_s2_cell(names(d)), dates = d) |>
tibble::glimpse()
#> ℹ checking that s2 are within the contiguous US
#> ✔ checking that s2 are within the contiguous US [57ms]
#>
#> ℹ adding coordinates
#> ✔ adding coordinates [277ms]
#>
#> ℹ adding elevation
#> ✔ adding elevation [1.2s]
#>
#> ℹ adding HMS smoke data
#> ✔ adding HMS smoke data [1.1s]
#>
#> ℹ adding NARR
#> ✔ adding NARR [432ms]
#>
#> ℹ adding gridMET
#> ✔ adding gridMET [422ms]
#>
#> ℹ adding MERRA
#> ✔ adding MERRA [873ms]
#>
#> ℹ adding time components
#> ✔ adding time components [20ms]
#>
#> Rows: 4
#> Columns: 23
#> $ s2 <s2cell> 8841b39a7c46e25f, 8841b39a7c46e25f, 8841a45555555…
#> $ date <date> 2023-05-18, 2023-11-06, 2023-06-22, 2023-08-15
#> $ x <dbl> 981664.4, 981664.4, 993445.3, 993445.3
#> $ y <dbl> 1850030, 1850030, 1833221, 1833221
#> $ elevation_median <dbl> 239, 239, 229, 229
#> $ elevation_sd <dbl> 18.88562, 18.88562, 14.62223, 14.62223
#> $ plume_smoke <dbl> 9, 2, 1, 2
#> $ hpbl <dbl> 654.3253, 536.9161, 775.3117, 1110.5875
#> $ temperature_max <dbl> 296.8, 295.2, 293.6, 296.3
#> $ temperature_min <dbl> 281.7, 276.2, 289.5, 289.2
#> $ precipitation <dbl> 0.0, 0.0, 0.0, 0.6
#> $ solar_radiation <dbl> 320.6, 110.2, 120.8, 234.9
#> $ wind_speed <dbl> 3.1, 5.2, 3.7, 5.0
#> $ wind_direction <int> 94, 209, 63, 284
#> $ specific_humidity <dbl> 0.00732, 0.00558, 0.01032, 0.01208
#> $ merra_dust <dbl> 1.7716578, 0.8419505, 1.3394157, 1.1787193
#> $ merra_oc <dbl> 6.839098, 2.653597, 2.519055, 2.797475
#> $ merra_bc <dbl> 0.5318720, 0.3922745, 0.3267147, 0.4414604
#> $ merra_ss <dbl> 0.9944661, 0.2441934, 0.3561678, 0.7222975
#> $ merra_so4 <dbl> 2.430319, 2.208039, 3.706336, 5.782006
#> $ merra_pm25 <dbl> 13.480237, 7.169391, 9.639784, 13.093671
#> $ year <dbl> 2023, 2023, 2023, 2023
#> $ doy <dbl> 138, 310, 173, 227