flow {hydropeak} | R Documentation |
'flow' S3 Class for Flow Rate Time Series
Description
The function flow()
creates a flow rate time series object
which is formatted to be compatible with the functions in the hydropeak
package.
Usage
flow(
x,
format = "%d.%m.%Y %H:%M",
tz = "Etc/GMT-1",
cols = c(1, 2, 3),
steplength = 15,
full = TRUE
)
validate_flow(x)
Arguments
x |
Data frame which contains at least a column with an ID of the gauging station, a column with date-time values in character representation and a column with flow rates |
format |
Character string giving the date-time format of the date-time
column in the input data frame (default: |
tz |
Character string specifying the time zone to be used for the conversion
(default: |
cols |
Integer vector specifying column indices in the input data frame which contain gauging station ID, date-time and flow rate to be renamed. The default indices are 1 (ID), 2 (date-time) and 3 (flow rate, Q). |
steplength |
Numeric value which specifies the distance between (equispaced)
time steps in minutes. (default: |
full |
A logical. If |
Value
Returns a flow
object which inherits from data frame (time series).
It contains at least a gauging station ID column (ID
) converted to
character values, a date-time column (Time
) converted to class "POSIXlt"
(see base::strptime()
) and a flow rate column
(Q
), which is converted to numeric values. The flow()
object
ensures that input flow fluctuation time series data can be processed with
the functions in the hydropeak package. Therefore, it is mandatory
to provide the correct indices (see argument cols
) and the correct
date-time format (see argument format
) of the input data frame.
Examples
data(Q)
Q <- flow(Q)