download data from DWD

Description

Get climate data from the German Weather Service (DWD) FTP-server. The desired .zip dataset is downloaded into dir, read, processed and returned as a data.frame

Usage

1
2
3
4
dataDWD(file,
  base1 = "ftp://ftp-cdc.dwd.de/pub/CDC/observations_germany/climate",
  base2 = "hourly/precipitation/recent", dir = "DWDdata", browse = 0:2,
  meta = 0:2, read = TRUE, format = NA, quiet = FALSE, ...)

Arguments

file

Filename (must be available at the location given by base1 and base2)

base1

Main directory of DWD ftp server (can probably always be left unchanged)

base2

Characterstring with subdirectory. DEFAULT: "hourly/precipitation/recent"

dir

Writeable directory on your computer. Created if not existent. DEFAULT: "DWDdata" at your current getwd()

browse

Integer specifying whether and how to open repository via browseURL.
0 for regular file download.
1 to open base1.
2 to open base1/base2).
If base= 1 or 2, no dir is created and no download performed. DEFAULT: 0

meta

Integer specifying whether to get metadata instead of actual data.
0 for regular file.
1 for meta data of all stations (meta is automatically set to 1 if file ends in ".txt". Column widths for read.fwf are computed internally).
2 for a list of the available files (requires RCurl to be installed. If meta=2, file="" is possible, as it is ignored anyways).
DEFAULT: 0

read

Read the file with readDWD? If FALSE, only download is performed. DEFAULT: TRUE

format

Format used in strptime to convert date/time column, see readDWD. DEFAULT: NA

quiet

Suppress message about directory? DEFAULT: FALSE

...

Further arguments currently ignored

Value

data.frame of the desired dataset (returned by readDWD if meta=0), presuming downloading and processing were successfull. Alternatively, links that were opened if browse!=0.

Note

These functions are now in the package rdwd and will be removed here! https://github.com/brry/rdwd

Author(s)

Berry Boessenkool, berry-b@gmx.de, Jun 2016

See Also

readDWD, download.file, monthAxis, climateGraph

Examples

1
2
# Don't use this anymore, use instead: 
#   browseURL("https://github.com/brry/rdwd#rdwd")

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.