readDWD.data: read regular dwd data

View source: R/readDWD.R

readDWD.dataR Documentation

read regular dwd data

Description

Read regular dwd data. Intended to be called via readDWD().

Usage

readDWD.data(
  file,
  fread = FALSE,
  varnames = FALSE,
  format = NA,
  tz = "GMT",
  hr = 0,
  quiet = rdwdquiet(),
  ...
)

Arguments

file

Name of file on harddrive, like e.g. DWDdata/daily_kl_recent_tageswerte_KL_03987_akt.zip

fread

Logical: read faster with data.table::fread? When reading many large historical files, speedup is significant. When called from readDWD(), fread=NA can also be used, which means TRUE if R package data.table and system command unzip are available. Hint for Windows users: unzip comes with Rtools. See https://bookdown.org/brry/rdwd/fread.html DEFAULT: FALSE

varnames

Logical (vector): add a short description to the DWD variable abbreviations in the column names? E.g. change ⁠FX,TNK⁠ to ⁠FX.Windspitze,TNK.Lufttemperatur_Min⁠, see newColumnNames(). DEFAULT: FALSE (for backwards compatibility)

format

Char (vector): Format passed to as.POSIXct() (see strptime()) to convert the date/time column to POSIX time format.
If NULL, no conversion is performed (date stays a factor). If NA, readDWD tries to find a suitable format based on the number of characters. DEFAULT: NA

tz

Char (vector): time zone for as.POSIXct(). "" is the current time zone, and "GMT" is UTC (Universal Time, Coordinated). DEFAULT: "GMT"

hr

Integer code to automatically merge historical and recent datasets. If set, readDWD returns a data.frame instead of a list. If multiple historical files are present, the longest date range (per file name) is used. This is not actually used in readDWD.data, but in readDWD().
0 (default): ignore this argument
1: sort by hr (if given) + merge
2: also remove duplicated dates from recent
3: also remove columns QN3,QN4,eor
4: also remove column STATIONS_ID
DEFAULT: 0

quiet

Suppress empty file warnings? DEFAULT: FALSE through rdwdquiet()

...

Further arguments passed to read.table() or data.table::fread()

Value

data.frame

Author(s)

Berry Boessenkool, berry-b@gmx.de

See Also

readDWD(), Examples in dataDWD()


brry/rdwd documentation built on April 18, 2024, 4:16 a.m.