Skip to contents

Send a query to the UKCP API for observation data and get a job (that will produce .csv outputs) started.

Usage

start_ukcp_observation_csv_job(
  label,
  API_KEY = Sys.getenv("UKCP_API_KEY"),
  identifier,
  area_type,
  area_details,
  collection,
  temp_avg,
  year_range,
  variable
)

Arguments

label

Job label for your request - this will appear in the UKCP API.

API_KEY

Your UKCP API key. Defaults to the UKCP_API_KEY environment variable if created.

identifier

Identifier for the dataset you would like to query.

area_type

How area you would like to cover is set up, eg a 'point', 'admin_region' or a 'bbox' (these are not the full set of options) to cover multiple grid cells.

area_details

The name or coordinates (northings/eastings) of the location you are interested in. If coordinates, the the point ID or edges of your boundary. In the latter case, enter as a vector with W, S, E, N boundaries in that order.

collection

The collection the queried dataset is part of.

temp_avg

The time period the data is broken down by, eg 'day' or 'may' (for data for that month, 'mall' for all months).

year_range

Years covered by your call. Enter as a vector in the following format: c(min_yr, max_yr).

variable

The measurement you are trying to extract, eg 'rainfall' or 'sun'.

Value

A list of information about your job, crucially the URL to use to get the results (when ready).

Examples

if (FALSE) {
 start_ukcp_observation_csv_job(
  label = "ukcpR-query",
  identifier = "LS6_Subset_02",
  area_type = "point",
  area_details = c(292500, 72500),
  collection = "land-obs_5",
  temp_avg = "day",
  year_range = c(1960, 2021),
  variable = "rainfall"
 )
 }