findID: find DWD weather station ID from name

View source: R/findID.R

findIDR Documentation

find DWD weather station ID from name

Description

Identify DWD weather station ID from station name

Usage

findID(
  name = "",
  exactmatch = TRUE,
  mindex = metaIndex,
  failempty = FALSE,
  quiet = rdwdquiet()
)

Arguments

name

Char: station name(s) that will be matched in mindex to obtain id. DEFAULT: ""

exactmatch

Logical: Should name match an entry in mindex exactly (be ==)? If FALSE, name may be a part of mindex$Stationsname, as checked with grepl(). This is useful e.g. to get all stations starting with a name (e.g. 42 IDs for Berlin). DEFAULT: TRUE

mindex

Single object: Index used to select id if name is given. DEFAULT: metaIndex

failempty

Logical: fail if no matching names are found (instead of returning NA with a warning)? With the latter, selectDWD() returns all files at a res/var/per folder. This may be especially unwanted with per="hr". DEFAULT: FALSE

quiet

Logical: suppress length warnings? DEFAULT: FALSE through rdwdquiet()

Value

Character string (vector) with ID(s)

Author(s)

Berry Boessenkool, berry-b@gmx.de, Oct-Nov 2016

See Also

used in selectDWD(), metaInfo()

Examples

# Give weather station name (must be existing in metaIndex):
findID("Potsdam")
findID("potsDam") # capitalization is ignored
# all names containing "Hamburg":
findID("Hamburg", exactmatch=FALSE)
findID("Potsdam", exactmatch=FALSE)

# vectorized:
findID(c("Potsdam","Berlin-Buch"))

# German Umlauts are changed to ue, ae, oe, ss
findID("Muenchen", FALSE)
berryFunctions::convertUmlaut("M?nchen") # use this to convert umlauts in lists


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