
Reads historic data files of the Tecson meteo station placed at Tiefenbrunnen and Mythenquai water police station.
Source:R/read-seepolizei.R
read_seepolizei.Rd
Reads historic data files of the Tecson meteo station placed at Tiefenbrunnen and Mythenquai water police station.
Usage
read_seepolizei(
fn,
site = c("ZH_Mythenquai", "ZH_Tiefenbrunnen"),
tz = "Etc/GMT-1",
time_shift = NULL,
na.rm = TRUE
)
Arguments
- fn
file name containing historic data
- site
measurement site of data. Should be "ZH_Mythenquai" or "ZH_Tiefenbrunnen"
- tz
Output time zone. The file content is in CET. Default "Etc/GMT-1"
- time_shift
a lubridate period to add to the time. Default NULL
- na.rm
remove na (empty) values. Default TRUE
Examples
input <- rOstluft.data::f("messwerte_tiefenbrunnen_2007-2019.csv")
data <- read_seepolizei(input, "ZH_Tiefenbrunnen")
# normalize data with meta informations
meta_data <- readRDS(rOstluft.data::f("meta_seepolizei.rds"))
# add units
data <- meta_apply(
data = data,
meta = meta_data,
data_src = "parameter",
data_dest = "unit",
meta_key = "parameter_original",
meta_val = "unit",
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
#> # A tibble: 750 × 6
#> starttime site parameter interval unit value
#> <dttm> <fct> <fct> <fct> <fct> <dbl>
#> 1 2007-04-15 10:20:00 ZH_Tiefenbrunnen T min10 °C 17.4
#> 2 2007-04-15 10:30:00 ZH_Tiefenbrunnen T min10 °C 16.7
#> 3 2007-04-15 10:40:00 ZH_Tiefenbrunnen T min10 °C 17
#> 4 2007-04-15 10:50:00 ZH_Tiefenbrunnen T min10 °C 17
#> 5 2007-04-15 11:00:00 ZH_Tiefenbrunnen T min10 °C 16.8
#> 6 2007-04-15 11:10:00 ZH_Tiefenbrunnen T min10 °C 16.6
#> 7 2007-04-15 11:20:00 ZH_Tiefenbrunnen T min10 °C 17
#> 8 2007-04-15 11:30:00 ZH_Tiefenbrunnen T min10 °C 17.3
#> 9 2007-04-15 11:40:00 ZH_Tiefenbrunnen T min10 °C 17.3
#> 10 2007-04-15 11:50:00 ZH_Tiefenbrunnen T min10 °C 17.6
#> # ℹ 740 more rows