load_latest_forecasts.Rd
#'
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") )#> Warning: `load_latest_forecasts()` was deprecated in covidHubUtils 0.1.5. #> This function has been superseded by the latest load_forecasts(). Please switch your code to using the new function.#> Warning: `load_latest_forecasts_zoltar()` was deprecated in covidHubUtils 0.1.5. #> This function has been superseded by the latest load_forecasts_zoltar(). Please switch your code to using the new function.#>#>#>#>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" )#>#>#>#>#> # A tibble: 448 × 16 #> model forecast_date location horizon temporal_resolu… target_variable #> <chr> <date> <chr> <chr> <chr> <chr> #> 1 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 2 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 3 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 4 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 5 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 6 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 7 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 8 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 9 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> 10 Columbia_UNC-SurvCon 2021-01-03 US 1 wk cum death #> # … with 438 more rows, and 10 more variables: target_end_date <date>, #> # type <chr>, quantile <dbl>, value <dbl>, location_name <chr>, #> # population <dbl>, geo_type <chr>, geo_value <chr>, abbreviation <chr>, #> # full_location_name <chr>