get_elements {frostr}R Documentation

Get metadata about the weather and climate elements that are defined in the Frost API

Description

get_elements() retrieves metadata about weather and climate elements defined for use in the Frost API. The function requires an input for client_id. The other function arguments are optional, and default to NULL, which means that the response from the API is not filtered on these parameters.

Usage

get_elements(client_id,
             ids = NULL,
             names = NULL,
             descriptions = NULL,
             units = NULL,
             code_tables= NULL,
             statuses = NULL,
             calculation_method = NULL,
             categories = NULL,
             time_offsets = NULL,
             sensor_levels = NULL,
             old_element_codes = NULL,
             old_units = NULL,
             cf_standard_names = NULL,
             cf_cell_methods = NULL,
             cf_units = NULL,
             cf_versions = NULL,
             fields = NULL,
             language = NULL,
             return_response = FALSE)

Arguments

client_id

A string. The client ID to use to send requests to the Frost API.

ids

A character vector. The element IDs to get metadata for.

names

A character vector. The element names to get metadata for.

descriptions

A character vector. The descriptions to get metadata for.

units

A character vector. The units to get metadata for.

code_tables

A character vector. The code tables to get metadata for.

statuses

A character vector. The statuses to get metadata for.

calculation_method

A string. The calculation method as a JSON filter. Supports the following keys: baseNames, methods, innerMethods, periods, innerPeriods, thresholds, methodDescriptions, innerMethodDescriptions, methodUnits, and innerMethodUnits.

categories

A character vector. The categories to get metadata for.

time_offsets

A character vector. The time offsets to get metadata for.

sensor_levels

A string. The sensor levels to get metadata for as a JSON filter. Supports the following keys: levelTypes, units, defaultValues, and values.

old_element_codes

A character vector. The old MET Norway element codes to get metadata for.

old_units

A character vector. The old MET Norway units to get metadata for.

cf_standard_names

A character vector. The CF standard names to get metadata for.

cf_cell_methods

A character vector. The CF cell methods to get metadata for.

cf_units

A character vector. The CF units to get metadata for.

cf_versions

A character vector. The CF versions to get metadata for.

fields

A character vector. Fields to include in the response (i.e. output). If this parameter is specified, then only these fields are returned in the response. If not specified, then all fields will be returned in the response.

language

A string. The language of the fields in the response. The options are "en-US" (default), "nb-NO" (Norwegian, Bokmål), and "nn-NO" (Norwegian, Nynorsk).

return_response

A logical. If set to TRUE, then the function returns the response from the GET request. If set to FALSE (default), then the function returns a tibble (data frame) of the content in the response.

Value

The function returns either a data frame with metadata about climate and weather elements, or the response of the GET request, depending on the boolean value set for return_response.

Examples

## Not run: 
frost_client_id <- "<YOUR FROST CLIENT ID>"

# Get data for all elements
elements_df <- get_elements(client_id = frost_client_id)

## End(Not run)


[Package frostr version 0.2.0 Index]