Skip to contents

Get daily PM2.5 model predictions

Usage

predict_pm25(x, dates)

Arguments

x

a vector of s2 cell identifers (s2_cell object)

dates

a list of date vectors for the predictions, must be the same length as x

Value

a list of tibbles the same length as x, each containing columns for the predicted (pm25) and its standard error (pm25_se); with one row per date in dates. These numerics are the concentrations of fine particulate matter, measured in micrograms per cubic meter. See vignette("cv-model-performance")

for more details on the cross validated accuracy of the daily PM2.5 model predictions.

Examples

d <- list(
  "8841b39a7c46e25f" = as.Date(c("2023-05-18", "2023-11-06")),
  "8841a45555555555" = as.Date(c("2023-06-22", "2023-08-15"))
)
predict_pm25(x = s2::as_s2_cell(names(d)), dates = d)
#>  (down)loading random forest model
#>  (down)loading random forest model [20.7s]
#> 
#>  checking that s2 locations are within the contiguous united states
#>  checking that s2 locations are within the contiguous united states [95ms]
#> 
#>  adding coordinates
#>  adding coordinates [19ms]
#> 
#>  adding elevation
#>  adding elevation [107ms]
#> 
#>  adding HMS smoke data
#>  adding HMS smoke data [1.1s]
#> 
#>  adding NARR
#>  adding NARR [5.7s]
#> 
#>  adding MERRA
#>  adding MERRA [894ms]
#> 
#>  adding time components
#>  adding time components [23ms]
#> 
#> [[1]]
#> # A tibble: 2 × 2
#>    pm25 pm25_se
#>   <dbl>   <dbl>
#> 1  7.95   0.917
#> 2  9.32   0.814
#> 
#> [[2]]
#> # A tibble: 2 × 2
#>    pm25 pm25_se
#>   <dbl>   <dbl>
#> 1  5.82   0.685
#> 2  7.68   0.765
#>