This helper function is a wrapper to save intermediate outputs running within the model fit loop as tsvs in the following file strucuture: scenario > forecast_date > model_type > location > type_of_output
Usage
save_table(
data_to_save,
type_of_output,
output_dir,
scenario,
forecast_date,
model_type = c("ww", "hosp"),
location
)
Arguments
- data_to_save
The dataframe/tibble to save
- type_of_output
The name of the type of output e.g. scores, quantiles, etc.
- output_dir
The upper level directory to save these outputs in
- scenario
A string indicating the scenario under which the model was run
- forecast_date
A string indicating the date of the forecast, in YYYY-MM-DD
- model_type
A string indicating the type of model (either
ww
orhosp
)- location
A string indicating the location (e.g. 2 letter abbreviation for the state)