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: "2024-02-01" "2024-02-02" ...
##  $ QN_3                      : int  10 10 10 10 10 10 10 10 10 10 ...
##  $ FX.Windspitze             : num  16.7 17.7 16.4 19.5 21 22.1 17 9.6 13.1 9.1 ...
##  $ FM.Windgeschwindigkeit    : num  7.6 7 8.1 7.7 9.9 10.4 6.1 2.4 5.3 3.7 ...
##  $ QN_4                      : int  9 9 9 9 9 9 9 9 9 9 ...
##  $ RSK.Niederschlagshoehe    : num  0.1 0 9.5 11.6 1.1 10.7 0.7 7.3 7.3 0.6 ...
##  $ RSKF.Niederschlagsform    : int  6 6 6 6 6 6 6 8 6 6 ...
##  $ SDK.Sonnenscheindauer     : num  5.3 0 0 0.1 0 0 0.3 0.4 0 2.4 ...
##  $ SHK_TAG.Schneehoehe       : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ NM.Bedeckungsgrad         : num  6.1 7.9 7.6 7.7 7.6 7.8 7.8 7.9 7.9 7.9 ...
##  $ VPM.Dampfdruck            : num  7.2 7.6 10.6 8.2 10.2 9.1 6.8 6.1 8.2 11.4 ...
##  $ PM.Luftdruck              : num  1012 1011 1006 1003 998 ...
##  $ TMK.Lufttemperatur        : num  5.7 6 9.1 6.9 9.5 9.9 3.6 1.2 4.1 9.8 ...
##  $ UPM.Relative_Feuchte      : num  78 81 91 83 86 75 85 91 98 94 ...
##  $ TXK.Lufttemperatur_Max    : num  8.5 8.2 10.8 8.2 10 11.3 8.4 4.2 9.4 13.6 ...
##  $ TNK.Lufttemperatur_Min    : num  3.8 3.3 6.5 4.7 7.8 8.3 -0.6 -1.1 0.3 8.5 ...
##  $ TGK.Lufttemperatur_5cm_min: num  1.5 1.2 4.5 2.2 7.3 7.5 -3.4 -4.1 0 5.1 ...
##  $ 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)