View source: R/bwb_rain_correction.R
read_BWB_rain_correction_long | R Documentation |
Read BWB Rain Correction Data in "long" format. The data is provided by BWB in the form of an Excel file. Save the file to CSV and run this function on that CSV file.
read_BWB_rain_correction_long(
files,
sep = ";",
country = c("de", "en")[1],
date.format = "%A %d. %B %Y",
locale = .localeString(country),
wide = TRUE,
dbg = TRUE
)
files |
full path to CSV file containing rain height correction data in "long" format |
sep |
column separator in |
country |
one of "de" (German) or "en" (English) according to the format numeric strings are given in |
date.format |
format used to convert the date string into a date object |
locale |
locale string, passed to
|
wide |
if |
dbg |
logical. If |
data frame either in "wide" format (with the date in the first column
and the rain heights in the following columns named according to the
"object ids" of the rain gauges) or in "long" format (with columns
Date
, ObjNr
Pumpwerk
Niederschlag
). The mapping
between object ids and gauge names is returned in the attribute "gauges".
## Not run:
# Provide the path to an example file in this package
file <- "Niederschlag_example.csv"
file <- system.file("extdata", file, package = "kwb.read")
# Read the CSV file into a data frame in "long" format
correction.wide <- read_BWB_rain_correction_long(file)
# Read the CSV file into a data frame in "wide" format (gauges in columns)
correction.long <- read_BWB_rain_correction_long(file, wide = FALSE)
# Get the mapping between object IDs and gauge names from attribute "gauges"
kwb.utils::getAttribute(correction.wide, "gauges")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.