rdwd (version 1.4.0)

readDWD: Process data from the DWD CDC FTP Server

Description

Read climate data that was downloaded with dataDWD(). The data is unzipped and subsequently, the file(s) are read, processed and returned as a data.frame / raster object. For observational data, new users are advised to set varnames=TRUE to obtain more informative column names. readDWD will call internal (but documented) subfunctions depending on the argument type, see the overview in fileType(). Not all arguments to readDWD are used for all subfunctions, e.g. fread is used only by readDWD.data, while dividebyten is used in readDWD.raster and readDWD.asc. file can be a vector with several filenames. Most other arguments can also be a vector and will be recycled to the length of file.

Usage

readDWD(
  file,
  type = fileType(file),
  varnames = FALSE,
  fread = NA,
  format = NA,
  tz = "GMT",
  dividebyten = TRUE,
  var = "",
  progbar = !quiet,
  quiet = rdwdquiet(),
  ...
)

Arguments

file

Char (vector): name(s) of the file(s) downloaded with dataDWD(), e.g. "~/DWDdata/tageswerte_KL_02575_akt.zip" or "~/DWDdata/RR_Stundenwerte_Beschreibung_Stationen.txt"

type

Character (vector) determining which subfunction to call. DEFAULT: fileType(file).

varnames

Logical (vector): Expand column names? Only used in readDWD.data(). DEFAULT: FALSE (for backward compatibility)

fread

Logical (vector): read fast? Used in readDWD.data(). DEFAULT: NA (experimental, see issue 22)

format, tz

Format and time zone of time stamps, see readDWD.data()

dividebyten

Logical (vector): Divide the values in raster files by ten? Used in readDWD.raster() and readDWD.asc(). DEFAULT: TRUE

var

var for readDWD.nc(). DEFAULT: ""

progbar

Logical: present a progress bar with estimated remaining time? If missing and length(file)==1, progbar is internally set to FALSE. DEFAULT: !quiet

quiet

Logical: suppress messages? DEFAULT: FALSE through rdwdquiet()

Further arguments passed to the internal readDWD.* subfunctions (see fileType) and from those to the underlying actual reading functions

Value

For observational data, an invisible data.frame of the desired dataset, or a named list of data.frames if length(file) > 1. For gridded data, raster objects.

See Also

dataDWD(), readVars(), readMeta(), selectDWD(), fileType() https://bookdown.org/brry/rdwd

Examples

Run this code
# NOT RUN {
# see dataDWD and readDWD.* subfunctions

# }

Run the code above in your browser using DataLab