rdwd (version 1.2.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 is read, processed and returned as a data.frame / raster object. New users are advised to set varnames=TRUE to obtain more informative column names. readDWD will call internal (but documented) functions depending on the arguments multia, meta, stand, binary, raster, nc, radar, asc: to read observational data (overview): readDWD.data, readDWD.multia, readDWD.stand, readDWD.meta to read gridded data (overview): readDWD.binary, readDWD.raster, readDWD.radar, readDWD.nc, readDWD.asc Not all arguments to readDWD are used for all functions, e.g. fread is used only by .data, while dividebyten is used in .raster and .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, quiet = FALSE, progbar = !quiet, fread = FALSE,
  varnames = FALSE, var = "", format = NA, tz = "GMT",
  dividebyten = TRUE, multia = grepl("Standort.txt$", file),
  meta = grepl(".txt$", file), stand = grepl("standard_format", file),
  binary = grepl(".tar.gz$", file), raster = grepl(".asc.gz$", file),
  nc = grepl(".nc.gz$", file), radar = grepl(".gz$", file),
  asc = grepl(".tar$", file), ...)

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"

quiet

Logical: suppress messages? DEFAULT: FALSE

progbar

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

fread

Logical (vector): read fast? See readDWD.data. DEFAULT: FALSE (some users complain it doesn't work on their PC)

varnames

Logical (vector): Expand column names? See readDWD.data. DEFAULT: FALSE

var

var for readDWD.nc. DEFAULT: ""

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

multia

Logical (vector): is the file a multi_annual file? Overrides meta, so set to FALSE manually if readDWD.meta needs to be called on a (manually renamed) Beschreibung file ending with "Standort.txt". See readDWD.multia. DEFAULT: TRUE for each file ending in "Standort.txt"

meta

Logical (vector): is the file a meta file (Beschreibung.txt)? See readDWD.meta. DEFAULT: TRUE for each file ending in ".txt"

stand

Logical (vector): is the file a subdaily/standard_format file? See readDWD.stand. DEFAULT: TRUE fo files containing "standard_format" in the name.

binary

Logical (vector): does the file contain binary files? See readDWD.binary. DEFAULT: TRUE for each file ending in ".tar.gz"

raster

Logical (vector): does the file contain a raster file? See readDWD.raster. DEFAULT: TRUE for each file ending in ".asc.gz"

nc

Logical (vector): does the file contain a netcdf file? See readDWD.nc. DEFAULT: TRUE for each file ending in ".nc.gz"

radar

Logical (vector): does the file contain a single binary file? See readDWD.radar. DEFAULT: TRUE for each file ending in ".gz"

asc

Logical (vector): does the file contain asc files? See readDWD.asc. DEFAULT: TRUE for each file ending in ".tar"

Further arguments passed to the internal readDWD.* functions and from those to the underlying reading functions documented in each internal function.

Value

Invisible data.frame of the desired dataset, or a named list of data.frames if length(file) > 1. readDWD.binary, readDWD.raster and readDWD.asc return raster objects instead of data.frames.

See Also

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

Examples

Run this code
# NOT RUN {
# see dataDWD

# }

Run the code above in your browser using DataCamp Workspace