job_data: Gets a job's file's data

View source: R/job.R

job_dataR Documentation

Gets a job's file's data

Description

Downloads the data for jobs that have an associated file, such as a query's results. Called on Jobs that are the results of a project forecast or truth queries via submit_query(). NB: It is a 404 Not Found error if this is called on a Job that has no underlying S3 data file, which can happen b/c: 1) 24 hours has passed (the expiration time) or 2) the Job is not complete and therefore has not saved the data file. For the latter you may use busy_poll_job() to ensure the job is done.

Usage

job_data(zoltar_connection, job_url, query_type)

Arguments

zoltar_connection

A ZoltarConnection object as returned by new_connection()

job_url

URL of a valid job in zoltar_connection that has a data file associated with it

query_type

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

Value

A data.frame of Job's data. The columns depend on query_type - see https://docs.zoltardata.com/fileformats/#truth-data-format-csv and https://docs.zoltardata.com/fileformats/#forecast-data-format-csv.

Examples

## Not run: 
  the_job_data <- job_data(conn, "http://example.com/api/job/2/")

## End(Not run)

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