Make a request to the /telemetrystations/telemetrytimeseries endpoint to retrieve raw, hourly, or daily telemetry station time series data by station abbreviations, within a given date range (start and end dates).
Usage
get_telemetry_ts(
abbrev = NULL,
parameter = "DISCHRG",
start_date = "1900-01-01",
end_date = Sys.Date(),
timescale = "day",
include_third_party = TRUE,
api_key = NULL
)
Arguments
- abbrev
character indicating station abbreviation
- parameter
character indicating which parameter should be retrieved. Default is "DISCHRG" (discharge), all parameters are not avaliable at all telemetry stations.
- start_date
character date to request data start point YYYY-MM-DD. Default is start date is "1900-01-01".
- end_date
character date to request data end point YYYY-MM-DD. Default end date is the current date the function is run.
- timescale
character indicating data type to return, either "raw", "hour", or "day". Default is "day"
- include_third_party
logical, Whether to retrieve data from other third party sources if necessary. Default is TRUE
- api_key
character, API authorization token, optional. If more than maximum number of requests per day is desired, an API key can be obtained from CDSS.
Examples
if (FALSE) {
# Retrieve daily discharge for CLAFTCCO telemetry station
telem_ts <- get_telemetry_ts(
abbrev = "CLAFTCCO",
parameter = "DISCHRG",
start_date = "2015-01-01",
end_date = "2022-01-01",
timescale = "day",
include_third_party = TRUE
)
# Plot daily discharge data
plot(telem_ts$meas_value~telem_ts$datetime, type = "l")
}