View source: R/read-seepolizei.R
get_seepolizei | R Documentation |
get_seepolizei()
uses the Tecdottir API from Stefan Oderholz.
read_seepolizei_json()
parses the response of the API.
get_seepolizei(
start,
end,
site = c("tiefenbrunnen", "mythenquai"),
tz = "Etc/GMT-1"
)
read_seepolizei_json(txt, tz = "Etc/GMT-1")
start |
The start date after which the measurements should be returned. As string in format yyyy-mm-dd or as POSIXct, POSIXlt or Date |
end |
The end date before which the measurements should be returned. As string in format yyyy-mm-dd or as POSIXct, POSIXlt or Date |
site |
The site of which the values should be returned. Valid values are "mythenquai" and "tiefenbrunnen" |
tz |
Output time zone. The response content is in CET. Default "Etc/GMT-1" |
txt |
a JSON string, URL or file |
tibble in rolf format
get_seepolizei(as.Date("2020-03-01"), lubridate::dmy("02.03.2020"))
data <- get_seepolizei("2020-03-20", "2020-03-22", "mythenquai")
# normalize data with meta informations
meta_data <- readRDS(rOstluft.data::f("meta_seepolizei.rds"))
# rename station
data <- meta_apply(
data = data,
meta = meta_data,
data_src = "site",
data_dest = "site",
meta_key = "site_short",
meta_val = "site",
mode = "strict"
)
# rename parameters to Ostluft Conventions
data <- meta_apply(
data = data,
meta = meta_data,
data_src = "parameter",
data_dest = "parameter",
meta_key = "parameter_original",
meta_val = "parameter",
mode = "strict"
)
# show normalized data
data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.