develop_model: develop_model

View source: R/develop.R

develop_modelR Documentation

develop_model

Description

Specify start and end dates, and states to train a model. Note that this function requires MAIAC and NARR data be downloaded already. See maiac_download and get_narr.

Usage

develop_model(
  dt1,
  dt2,
  states,
  pa_cutoff = 1e+05,
  seed = 1977,
  bluesky_special = NULL,
  pa_data = NULL,
  bs_path = "./data/bluesky/archive/"
)

Arguments

dt1

date Start date of the model input data

dt2

date End date of the model input data

states

character A vector of two-letter state abbreviations

pa_cutoff

numeric The distance in meters to consider PurpleAir data in kriging. The default value is 100,000 m (100 km). create_purpleair_variogram.

seed

numeric A number to set the randomization seed for reproducibility

bluesky_special

character Handles two special cases of BlueSky data. If "2020", processes data prior to October 10, 2020 separately from that after, as the BlueSky data format changed. If "HAQAST", uses custom BlueSky-CMAQ output created during the HAQAST campaign (see https://doi.org/10.1080/10962247.2021.1891994O'Neill et al., 2021).

pa_data

character Path to an RDS file of pre-retrieved PurpleAir data from get_purpleair_daterange.

Value

A list with two items. model contains the model as returned by train. output is a dataframe with the input data and the modeled predictions.

Examples

dt1 <- as.Date("2018-11-01")
dt2 <- as.Date("2018-11-30")
pa <- "./data/purpleair/purpleair_2018.RDS"
mod_2018_nov_<- develop_model(dt1, dt2, states = "CA", pa_data = pa)

raffscallion/rapidfire documentation built on June 1, 2025, 2:04 p.m.