10 - use case: recent time series

download & read data

## rdwd::updateRdwd()
library(rdwd)
link <- selectDWD("Potsdam", res="daily", var="kl", per="recent")
clim <- dataDWD(link, force=NA, varnames=TRUE)
str(clim)
## 'data.frame':    550 obs. of  19 variables:
##  $ STATIONS_ID               : int  3987 3987 3987 3987 3987 3987 3987 3987 3987 3987 ...
##  $ MESS_DATUM                : Date, format: "2023-01-23" "2023-01-24" ...
##  $ QN_3                      : int  10 10 10 10 10 10 10 10 10 10 ...
##  $ FX.Windspitze             : num  7.5 5.5 7.2 5.3 10 7.3 13.1 23.5 19.1 17.8 ...
##  $ FM.Windgeschwindigkeit    : num  2.8 2 2 2.1 2.7 2.3 5.2 8.4 7.9 8.3 ...
##  $ QN_4                      : int  9 9 9 9 9 9 9 9 9 9 ...
##  $ RSK.Niederschlagshoehe    : num  0 0 0 0 0.4 0 0.2 2.8 2.5 5.9 ...
##  $ RSKF.Niederschlagsform    : int  7 0 6 8 8 6 8 6 6 6 ...
##  $ SDK.Sonnenscheindauer     : num  0 0 0 0 0 0 0.6 1 0 0.1 ...
##  $ SHK_TAG.Schneehoehe       : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ NM.Bedeckungsgrad         : num  7.9 8 8 8 7.8 7.7 7.9 6.5 6.8 7.3 ...
##  $ VPM.Dampfdruck            : num  6.2 5.4 5.9 5.3 6.2 4.6 5.6 6.6 7.1 6.9 ...
##  $ PM.Luftdruck              : num  1025 1028 1020 1010 1012 ...
##  $ TMK.Lufttemperatur        : num  1.6 0.5 0.3 -1.1 1.2 0 0.7 3.6 4.1 4.2 ...
##  $ UPM.Relative_Feuchte      : num  90 85 94 95 92 76 87 83 86 84 ...
##  $ TXK.Lufttemperatur_Max    : num  2.5 1.2 1.1 -0.6 3.1 1.4 3 7 6.1 6.2 ...
##  $ TNK.Lufttemperatur_Min    : num  0.8 -0.5 -0.6 -1.7 -0.6 -2.3 -1.2 1 2.2 2 ...
##  $ TGK.Lufttemperatur_5cm_min: num  0.3 -0.6 -0.7 -1.7 -0.7 -5.2 -1.9 0.5 0.5 0.9 ...
##  $ eor                       : Factor w/ 1 level "eor": 1 1 1 1 1 1 1 1 1 1 ...

plot time series

par(mar=c(4,4,2,0.5), mgp=c(2.7, 0.8, 0), cex=0.8)
plot(clim[,c(2,14)], type="l", xaxt="n", las=1, main="Daily temp Potsdam")
berryFunctions::monthAxis()   ;   abline(h=0)
mtext("Source: Deutscher Wetterdienst", adj=-0.1, line=0.5, font=3)