get_events_file {hydropeak} | R Documentation |
Flow Fluctuation Events and Metrics from Input File
Description
Given a file path it reads a data frame (time series) of stage
measurements and calls get_events()
.
The resulting events can be optionally written to a single file or to
separate files for each gauging station ID (ID
) and Event_Type
.
Files which produce errors return NULL
.
Usage
get_events_file(
Q_file,
inputsep = ";",
inputdec = ".",
save = FALSE,
split = TRUE,
outdir = file.path(tempdir(), "Events"),
mc.cores = 2L,
return = TRUE,
...
)
Arguments
Q_file |
A character string containing the name of the file which the data
are to be read from with |
inputsep |
Field separator character string for input data. |
inputdec |
Character string for decimal points in input data. |
save |
A logical. If |
split |
A logical. If |
outdir |
A character string naming a directory where the output file(s) should be written to. |
mc.cores |
Number of cores to use with
|
return |
A logical. If |
... |
Arguments to be passed to |
Value
A data frame which contains for every increase or decrease event in a
given time series all metrics (all_metrics()
),
gauging station ID, event type, and starting time of an event.
Included metrics are amp()
, mafr()
,
mefr()
, dur()
, ratio()
.
The returned data frame is not split. Returns NULL
, if argument
return
is set to FALSE
.
Examples
Q_file <- system.file("extdata", "Q.csv", package = "hydropeak")
# save to tempdir()
events <- get_events_file(Q_file, inputsep = ",", inputdec = ".",
save = TRUE, split = TRUE, return = TRUE)