Closed dimfalk closed 7 months ago
library(netatmo.weather)
#> 0.5.4
# set_credentials()
# fetch_token()
e <- get_extent("Dresden")
stations <- get_publicdata(e)
# define period exceeding allowed maximum
p <- get_period(c("2024-01-01", "2024-01-15"))
as.POSIXct(p, origin = "1970-01-01")
#> "2024-01-01 CET" "2024-01-15 CET"
# try to get observations for a single station
obs <- get_measure(devices = stations[1, ],
period = p,
par = "temperature",
res = 5)
# check xts index range
zoo::index(obs[[1]]) |> range()
#> "2024-01-01 00:00:00 CET" "2024-01-14 23:55:00 CET"
# check xts attributes
attr(obs[[1]], "TS_START")
#> "2024-01-01 CET"
attr(obs[[1]], "TS_END")
#> "2024-01-14 23:55:00 CET"