View source: R/load_latest_forecasts.R
load_latest_forecasts | R Documentation |
#' \Sexpr[results=rd, stage=render]{lifecycle::badge("deprecated")}
Please use load_forecasts()
instead.
load_latest_forecasts(
models = NULL,
last_forecast_date,
forecast_date_window_size = 0,
locations = NULL,
types = NULL,
targets = NULL,
source = "local_hub_repo",
hub_repo_path,
data_processed_subpath = "data-processed/",
as_of = NULL,
hub = c("US", "ECDC"),
verbose = TRUE
)
models |
Character vector of model abbreviations. If missing, forecasts for all models that submitted forecasts meeting the other criteria are returned. |
last_forecast_date |
The forecast date of forecasts to retrieve in 'yyyy-mm-dd' format. |
forecast_date_window_size |
The number of days across which to look for recent forecasts. Default to 0, which means to only look at the last_forecast_date only. |
locations |
list of fips. Defaults to all locations with available forecasts. |
types |
Character vector specifying type of forecasts to load: "quantile" or "point". Defaults to all types with available forecasts |
targets |
character vector of targets to retrieve, for example c('1 wk ahead cum death', '2 wk ahead cum death'). Defaults to all targets. |
source |
string specifying where forecasts will be loaded from: either "local_hub_repo" or "zoltar" |
hub_repo_path |
path to local clone of the reichlab/covid19-forecast-hub repository |
data_processed_subpath |
folder within the hub_repo_path that contains forecast submission files. Defaults to "data-processed/", which is appropriate for the covid19-forecast-hub repository. |
as_of |
character for date time to load forecasts submitted as of this time from Zoltar.
Ignored if |
hub |
character vector, where the first element indicates the hub from which to load forecasts. Possible options are "US" and "ECDC" |
verbose |
a boolean for printing messages on zoltar job status. Default to TRUE. |
data frame with columns model, forecast_date, location, horizon, temporal_resolution, target_variable, target_end_date, type, quantile, value, location_name, population, geo_type, geo_value, abbreviation
forecasts <- load_latest_forecasts(
models = "COVIDhub-ensemble",
last_forecast_date = "2020-12-07",
forecast_date_window_size = 6,
locations = "US",
types = c("point", "quantile"),
targets = paste(1:4, "wk ahead inc case"),
source = "zoltar",
verbose = FALSE,
as_of = NULL,
hub = c("US")
)
forecasts_ECDC <- load_latest_forecasts(
models = c("ILM-EKF"),
hub = c("ECDC", "US"),
last_forecast_date = "2021-03-08",
forecast_date_window_size = 0,
locations = c("GB"),
targets = paste(1:4, "wk ahead inc death"),
source = "zoltar"
)
load_latest_forecasts(
models = "Columbia_UNC-SurvCon",
last_forecast_date = "2021-01-03",
source = "zoltar",
as_of = "2021-01-04",
verbose = FALSE,
location = "US"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.