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 / terra 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
.
readDWD(
file,
type = fileType(file),
varnames = FALSE,
fread = NA,
format = NA,
tz = "GMT",
hr = 0,
dividebyten = TRUE,
var = "",
progbar = !quiet,
quiet = rdwdquiet(),
quietread = quiet,
...
)
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, terra raster objects.
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"
Character (vector) determining which subfunction to call.
DEFAULT: fileType
(file)
.
Logical (vector): Expand column names?
Only used in readDWD.data()
.
DEFAULT: FALSE (for backward compatibility)
Logical (vector): read fast? Used in readDWD.data()
.
DEFAULT: NA
Format and time zone of time stamps, see readDWD.data()
Integer code to merge historical and recent file.
Used here, but documented in detail in readDWD.data()
.
DEFAULT: 0 (ignore argument)
Logical (vector): Divide the values in raster files by ten?
That way, [1/10 mm] gets transformed to [mm] units.
Used in readDWD.radar()
, readDWD.raster()
and readDWD.asc()
.
DEFAULT: TRUE
var for readDWD.nc()
. DEFAULT: ""
Logical: present a progress bar with estimated remaining time? If missing and length(file)==1, progbar is internally set to FALSE, unless binary files are to be read. DEFAULT: !quiet
Logical: suppress messages? DEFAULT: FALSE through rdwdquiet()
Logical: suppress message like
"Reading 1 file with readDWD.data() and fread=TRUE ...".
DEFAULT: quiet
Further arguments passed to the internal readDWD.*
subfunctions (see fileType
) and from those to the
underlying actual reading functions
Berry Boessenkool, berry-b@gmx.de, Jul-Oct 2016, Winter 2018/19
dataDWD()
, readVars()
, readMeta()
, selectDWD()
, fileType()
https://bookdown.org/brry/rdwd
# see dataDWD and readDWD.* subfunctions
Run the code above in your browser using DataLab