This package contains functions for working with the Zoltar forecast repository’s API, including projects, models, forecasts, and truth. Read more about this package at the zoltr pkgdown site. Documentation on Zolar itself is at docs.zoltardata.com.


You can install the released version of zoltr from CRAN with:

And the development version from GitHub with:

# install.packages("remotes")

Note: Due to the rapid pace of zoltr development, CRAN version lags behind development. We highly suggest you install the development version to get the latest features.

Getting started

For those starting out we recommend you begin with the Getting Started vignette.


Read more at the zoltr pkgdown site, but briefly you use the new_connection() function to create a connection to Zoltar and then pass that connection along with the URL of the resource of interest (e.g., a project, model, or forecast) to this package’s various functions like projects() or project_info().

zoltar_connection <- new_connection()
zoltar_authenticate(zoltar_connection, Sys.getenv("Z_USERNAME"), Sys.getenv("Z_PASSWORD"))
#> ZoltarConnection 'https://zoltardata.com' authenticated (exp=2021-10-19 15:07:55 UTC)
the_projects <- projects(zoltar_connection)
project_url <- the_projects[the_projects$name == "Docs Example Project", "url"]
the_project_info <- project_info(zoltar_connection, project_url)
#>  [1] "id"                    "url"                   "owner"                
#>  [4] "is_public"             "name"                  "description"          
#>  [7] "home_url"              "logo_url"              "core_data"            
#> [10] "time_interval_type"    "visualization_y_label" "truth"                
#> [13] "model_owners"          "models"                "units"                
#> [16] "targets"               "timezeros"
#> [1] "Docs Example Project"

Forecast data format

The native forecast data format supported by the Zoltar API is a list. See docs.zoltardata.com for format details. You can find an example at vignettes/docs-predictions.json . By convention this package referred to this as forecast_data. This package supports conversion to this format (which is used throughout the package) from the CDC’s CSV file format [1] via the forecast_data_from_cdc_csv_file() function. Future versions will support bidirectional conversion, as well as support for a more general CSV format.

[1] Details about the CDC CSV format can be found at flu_challenge_2016-17_update.docx.