createlfobj: Create an low flow object for further Low Flow Analysis

View source: R/lfobj.R

createlfobjR Documentation

Create an low flow object for further Low Flow Analysis

Description

Generic function for creating a low flow object (class 'lfobj'). Low flow objects can be created from a time series of daily flow, a data.frame with columns "flow", "day", "month" and "year".

Usage

createlfobj(x, ...)


## S3 method for class 'data.frame'
createlfobj(x, hyearstart = NULL, baseflow = TRUE,
            meta = list(),...)

## S3 method for class 'ts'
createlfobj(x,
            startdate,
            dateformat = "%d/%m/%Y",
            ...)

## S3 method for class 'lfobj'
createlfobj(x, hyearstart = NULL, baseflow = NULL,
            meta = NULL,...)

Arguments

x

An object out of which an object of class 'lfobj' should be created

hyearstart

integer between 1 and 12, indicating the start of the hydrological year.

baseflow

logical, should the base flow curve be calculated? Needed, if you want to apply functions 'bfplot' or 'BFI' later on.

meta

A list of meta-information

startdate

start of the time-series

dateformat

Format of the start date

...

Additional arguments, passed on to createlfobj.data.frame.

Details

'hyearstart' defines the starting month of the hydrological year. If 'hyearstart' is greater then 6.5, the hydrological year starts earlier then the actual date, e.g. hyearstart = 10, then the 1st of October 2011 is part of the hydrological year 2012. If hyearstart = 4, then the 31st of March 2011 is part of the hydrological year 2010.

When creating an object of class lfobj with the aforementioned functions, eventually createlfobj.data.frame is called.

Value

An object of class 'lfobj'.

Author(s)

Daniel Koffler and Gregor Laaha

References

Gustard, A. & Demuth, S. (2009) (Eds) Manual on Low-flow Estimation and Prediction. Operational Hydrology Report No. 50, WNO-No. 1029, 136p.

See Also

readlfdata

Examples

# Creating a lfobj from a timeseries
# Some sample data:
somevalues <- rexp(365)

# Convert to time series:
time <- ts(somevalues)

# Lets say our data contains values from one hydrological year (Oct-Sep)
# starting on 1. Oct. 1992:
myriver <- createlfobj(time, startdate = "01/10/1992",hyearstart = 10)

# Add meta-data
createlfobj(myriver, meta = list(river = "myriver"))

lfstat documentation built on Nov. 10, 2022, 5:42 p.m.