get_available_timeseries()
retrieves metadata on available
time series that you can get from the Frost API "observations" resource
with get_observations()
. The function requires input for
client_id
and sources
. The other function arguments are optional,
and default to NULL
, which means that the response from the API is not
filtered on these parameters.
get_available_timeseries(client_id,
sources,
reference_time = NULL,
elements = NULL,
time_offsets = NULL,
time_resolutions = NULL,
time_series_ids = NULL,
performance_categories = NULL,
exposure_categories = NULL,
levels = NULL,
level_types = NULL,
level_units = NULL,
fields = NULL,
return_response = FALSE)
A string. The client ID to use to send requests to the Frost API.
A character vector. The station IDs of the data sources
to get observations for. For example, "SN18700" is the station ID for
"Blindern". The full list of station IDs can be retrieved with
get_sources()
.
A string. The time range to get observations for in either extended ISO-8601 format or the single word "latest".
A character vector. The elements to get observations for.
The full list of elements can be retrieved with the
get_elements()
.
A character vector. The time offsets to get observations
for provided as a vector of ISO-8601 periods, e.g. c("PT6H", "PT18H")
.
A character vector. The time resolutions to get
observations for provided as a vector of ISO-8601 periods e.g.
c("PT6H", "PT18H")
.
A numeric vector. The internal time series IDs to get observations for as a vector of integers, e.g. c(0, 1).
A character vector. The performance categories
to get observations for as a vector of letters, e.g. c("A", "C")
.
A numeric vector. The exposure categories to get
observations for as a vector of integers, e.g. c(1, 2)
.
A numeric vector. The sensor levels to get observations for as
a vector of integers, e.g. c(1, 2, 10, 20)
.
A character vector. The sensor level types to get data for.
A character vector. The sensor level units to get data for.
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.
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.
The function returns either a data frame with metadata about
available time series, or the response of the GET request, depending
on the boolean value set for return_response
.
# NOT RUN {
frost_client_id <- "<YOUR FROST CLIENT ID>"
# Get metadata on available time series for Blindern station (with station
# ID SN18700)
sources <- "SN18700"
obs_available_ts <- get_available_timeseries(client_id = frost_client_id,
sources = sources)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab