R/project.R
do_zoltar_query.Rd
A convenience function to construct and execute a Zoltar query for either forecast or truth data.
do_zoltar_query(
zoltar_connection,
project_url,
query_type,
models = NULL,
units = NULL,
targets = NULL,
timezeros = NULL,
types = NULL,
as_of = NULL,
verbose = TRUE
)
A ZoltarConnection
object as returned by new_connection()
URL of a project in zoltar_connection's projects
A character indicating the type of query to run. Must be one of: "forecasts" or "truth".
Character vector of model abbreviations. Used for query_type = "forecasts".
Character vector of units to retrieve. Used for all query_types.
Character vector of targets to retrieve. Used for all query_types.
Character vector of timezeros to retrieve in YYYY_MM_DD_DATE_FORMAT, e.g., '2017-01-17'. Used for all query_types.
Character vector of prediction types to retrieve. Used for query_type = "forecasts".
a datetime used for either query_type that constrains based on forecast issued_at
.
must be a datetime as parsed by the dateutil python library
https://dateutil.readthedocs.io/en/stable/index.html , which accepts a variety of styles.
if TRUE, print messages on job status poll
A data.frame
of Job's data. Full documentation at https://docs.zoltardata.com/.
if (FALSE) {
forecast_data <- do_zoltar_query(
conn, "https://www.zoltardata.com/api/project/44/", "forecasts",
models=c("CMU-TimeSeries", "UMass-MechBayes"), units=c("01003", "US"),
targets=c("1 wk ahead inc death"), targets=c("2020-07-19", "2020-07-20"),
types=c("quantile"), as_of="2020-07-10")
truth_data <- do_zoltar_query(
conn, "https://www.zoltardata.com/api/project/44/", "truth", c("01003", "US"),
c("1 wk ahead inc death"), c("2020-07-19", "2020-07-20"))
}