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", "2024-09-30"))
)
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 [397ms]
#>
#> ℹ adding elevation
#> ✔ adding elevation [1.3s]
#>
#> ℹ adding HMS smoke data
#> ✔ adding HMS smoke data [1.1s]
#>
#> ℹ adding NARR
#> ✔ adding NARR [848ms]
#>
#> ℹ adding gridMET
#> ✔ adding gridMET [974ms]
#>
#> ℹ adding MERRA
#> ✔ adding MERRA [1.3s]
#>
#> ℹ adding time components
#> ✔ adding time components [21ms]
#>
#> Rows: 5
#> Columns: 23
#> $ s2 <s2cell> 8841b39a7c46e25f, 8841b39a7c46e25f, 8841a45555555…
#> $ date <date> 2023-05-18, 2023-11-06, 2023-06-22, 2023-08-15, 202…
#> $ x <dbl> 981664.4, 981664.4, 993445.3, 993445.3, 993445.3
#> $ y <dbl> 1850030, 1850030, 1833221, 1833221, 1833221
#> $ elevation_median <dbl> 239, 239, 229, 229, 229
#> $ elevation_sd <dbl> 18.88562, 18.88562, 14.62223, 14.62223, 14.62223
#> $ plume_smoke <dbl> 9, 2, 1, 2, 0
#> $ hpbl <dbl> 654.3253, 536.9161, 775.3117, 1110.5875, 354.2172
#> $ temperature_max <dbl> 296.8, 295.2, 293.6, 296.3, 297.7
#> $ temperature_min <dbl> 281.7, 276.2, 289.5, 289.2, 290.7
#> $ precipitation <dbl> 0.0, 0.0, 0.0, 0.6, 0.0
#> $ solar_radiation <dbl> 320.6, 110.2, 120.8, 234.9, 99.6
#> $ wind_speed <dbl> 3.1, 5.2, 3.7, 5.0, 1.0
#> $ wind_direction <int> 94, 209, 63, 284, 157
#> $ specific_humidity <dbl> 0.00732, 0.00558, 0.01032, 0.01208, 0.01241
#> $ merra_dust <dbl> 1.7716578, 0.8419505, 1.3394157, 1.1787193, 0.6252539
#> $ merra_oc <dbl> 6.839098, 2.653597, 2.519055, 2.797475, 1.802974
#> $ merra_bc <dbl> 0.5318720, 0.3922745, 0.3267147, 0.4414604, 0.5079823
#> $ merra_ss <dbl> 0.99446614, 0.24419342, 0.35616784, 0.72229751, 0.08…
#> $ merra_so4 <dbl> 2.430319, 2.208039, 3.706336, 5.782006, 4.615898
#> $ merra_pm25 <dbl> 13.480237, 7.169391, 9.639784, 13.093671, 9.370406
#> $ year <dbl> 2023, 2023, 2023, 2023, 2024
#> $ doy <dbl> 138, 310, 173, 227, 274