Handle climate data from the 'DWD' ('Deutscher Wetterdienst', see < https://www.dwd.de/EN/climate_environment/cdc/cdc.html> for more information). Choose observational time series from meteorological stations with 'selectDWD()'. Find raster data from radar and interpolation according to < https://bookdown.org/brry/rdwd/raster-data.html>. Download (multiple) data sets with progress bars and no re-downloads through 'dataDWD()'. Read both tabular observational data and binary gridded datasets with 'readDWD()'.
rdwd
is an R package to select, download and read climate data from the
German Weather Service (Deutscher Wetterdienst, DWD).
They provide over 228 thousand datasets with weather observations online at
ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate.
It has been presented at FOSDEM 2017 and UseR!2017 in Brussels, featured in Rstudios data package list and written about in OSOR.
Usage of the package usually looks something like the following:
# download and install the rdwd package (only needed once):install.packages("rdwd")berryFunctions::instGit("brry/rdwd") # latest development version (if wanted) # load the package into library (needed in every R session):library(rdwd) # select a dataset (e.g. last year's daily climate data from Potsdam City):link <- selectDWD("Potsdam", res="daily", var="kl", per="recent") # Actually download that dataset, returning the local storage file name:file <- dataDWD(link, read=FALSE) # Read the file from the zip folder:clim <- readDWD(file) # Inspect the data.frame:str(clim)
You can also select datasets with the interactive map.
Installation instructions and more examples are available in the package vignette.
vignette("mapDWD") # interactive map, likely faster than CRAN link abovevignette("rdwd") # package instructions and examples
A real-life usage example of the package can be found at https://github.com/brry/prectemp/blob/master/Code_analysis.R
I'm looking for someone to help implement multiple downloads in dataDWD via e.g. curl
or wget
.
The requirements are as follows:
rdwd ToDo-list / wishlist / issues
rdwd Version history
Version 1.0.0 (2019-03-17) First major version increase! Tests are now systematic and comprehensive (albeit run locally and manually to reduce CRAN load and enable local file writing). selectDWD got a very noticable performance boost and an interactive res/var/per selection. Handling raster files is now supported in rdwd. Examples and vignettes have been refined. Detailed changes can be found on https://github.com/brry/rdwd/commits, here's the main overview:
Version 0.11.0 (2018-11-26)
Version 0.10.0 (2018-03-26)
Version 0.9.0 (2017-11-03)
Version 0.8.0 (2017-06-09) reflects DWD FTP update June 1
Version 0.7.0 (2017-02-03)
Version 0.6.1 (2017-01-24) Initial release of the package, development can be seen at https://github.com/brry/rdwd/compare/[email protected]{2016-10-19}[email protected]{2017-01-24}
'selectDWD' uses index information to find files matching a path or station criteria. With the returned path/file names, 'dataDWD' and 'readDWD' download and read data. 'dirDWD' and 'fileDWD' control that no file will be overwritten and path messages are useful. 'indexDWD' lists all the files on the FTP server with DWD data. 'createIndex' uses that list to create 'fileIndex', 'metaIndex' and 'geoIndex'. 'mapDWD' is an interactive leaflet map also useful to explore datasets.
Note: 'dataDWD' and 'readDWD' were started in June 2016 within my misc package berryFunctions, from which they will be deleted after rdwd is on CRAN