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
.
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), ...)
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"
Logical: suppress messages? DEFAULT: FALSE
Logical: present a progress bar with estimated remaining time? If missing and length(file)==1, progbar is internally set to FALSE. DEFAULT: !quiet
Logical (vector): read fast? See readDWD.data
.
DEFAULT: FALSE (some users complain it doesn't work on their PC)
Logical (vector): Expand column names?
See readDWD.data
. DEFAULT: FALSE
var for readDWD.nc
. DEFAULT: ""
Format and time zone of time stamps, see readDWD.data
Logical (vector): Divide the values in raster files by ten?
Used in readDWD.raster
and readDWD.asc
.
DEFAULT: TRUE
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"
Logical (vector): is the file
a meta file (Beschreibung.txt)?
See readDWD.meta
.
DEFAULT: TRUE for each file ending in ".txt"
Logical (vector): is the file
a subdaily/standard_format file?
See readDWD.stand
.
DEFAULT: TRUE fo files containing "standard_format" in the name.
Logical (vector): does the file
contain binary files?
See readDWD.binary
.
DEFAULT: TRUE for each file ending in ".tar.gz"
Logical (vector): does the file
contain a raster file?
See readDWD.raster
.
DEFAULT: TRUE for each file ending in ".asc.gz"
Logical (vector): does the file
contain a netcdf file?
See readDWD.nc
.
DEFAULT: TRUE for each file ending in ".nc.gz"
Logical (vector): does the file
contain a single binary file?
See readDWD.radar
.
DEFAULT: TRUE for each file ending in ".gz"
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.
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.
dataDWD
, readVars
,
readMeta
, selectDWD
https://bookdown.org/brry/rdwd
# NOT RUN {
# see dataDWD
# }
Run the code above in your browser using DataCamp Workspace