9 - use case: recent time series

download & read data

library(rdwd)
link <- selectDWD("Potsdam", res="daily", var="kl", per="recent")
file <- dataDWD(link, read=FALSE, dir="../localdata", force=NA, overwrite=TRUE)
clim <- readDWD(file, 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                : POSIXct, format: "2019-03-21" "2019-03-22" ...
##  $ QN_3                      : int  10 10 10 10 10 10 10 10 10 10 ...
##  $ FX.Windspitze             : num  8.1 7.4 10.4 6.6 13 16.3 12.3 9.1 6.5 9.7 ...
##  $ FM.Windgeschwindigkeit    : num  3.4 2.5 4 2.7 4.9 5.9 4.8 3.8 2.6 4.1 ...
##  $ QN_4                      : int  3 3 3 3 3 3 3 3 3 3 ...
##  $ RSK.Niederschlagshoehe    : num  0 0 0 0.1 2.1 1.7 3.8 1.3 0 0 ...
##  $ RSKF.Niederschlagsform    : int  0 0 0 8 8 6 6 6 0 0 ...
##  $ SDK.Sonnenscheindauer     : num  1.53 3.2 10.05 7.2 4.1 ...
##  $ SHK_TAG.Schneehoehe       : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ NM.Bedeckungsgrad         : num  6.3 4.5 3.5 4.9 4.8 5.9 7.6 8 6.8 3.8 ...
##  $ VPM.Dampfdruck            : num  9.7 9.8 9.5 6.3 6.6 7 8.6 10.5 10.1 8.4 ...
##  $ PM.Luftdruck              : num  1021 1020 1015 1013 1004 ...
##  $ TMK.Lufttemperatur        : num  9.8 8.5 9.5 6.4 4 4.7 7.3 8.5 9.6 11.2 ...
##  $ UPM.Relative_Feuchte      : num  80.7 88.4 81 67.6 80.7 ...
##  $ TXK.Lufttemperatur_Max    : num  12.7 13.3 17.2 12.5 9 9 10.3 9.8 12.5 19.1 ...
##  $ TNK.Lufttemperatur_Min    : num  6.7 5.9 3.2 1.8 0.9 0.5 4.1 7.6 6 2.9 ...
##  $ TGK.Lufttemperatur_5cm_min: num  2.7 2.1 2 -1.3 -1.8 -1.7 2.7 7.4 2.7 0.8 ...
##  $ 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)