submit_query: Submit a query

View source: R/project.R

submit_queryR Documentation

Submit a query

Description

Submits a request for the execution of a query of either forecasts or truth in this Project.

Usage

submit_query(zoltar_connection, project_url, query_type, query)

Arguments

zoltar_connection

A ZoltarConnection object as returned by new_connection()

project_url

URL of a project in zoltar_connection's projects

query_type

A character indicating the type of query to run. Must be one of: "forecasts" or "truth".

query

A list of character lists that constrains the queried data. It is the analog of the JSON object documented at https://docs.zoltardata.com/. The keys vary depending on query_type. References to models, units, targets, and timezeros are strings that name the objects, and not IDs.

Value

a Job URL for tracking the query and getting its results when it successfully completes

Examples

## Not run: 
  job_url <- submit_query(conn, "https://www.zoltardata.com/api/project/9/", "forecasts",
                          list("models"=list("60-contact", "CovidIL_100"), "units"=list("US"),
                          "targets"=list(1894, 1897), "timezeros"=list("2020-05-14", "2020-05-09"),
                          "types"=list("point", "quantile")))

## End(Not run)

reichlab/zoltr documentation built on April 13, 2024, 2:13 a.m.