find_changeEvents: Function to decompose a flow series into flow direction...

View source: R/find_changeEvents.R

find_changeEventsR Documentation

Function to decompose a flow series into flow direction change events

Description

Function to decompose a flow series into flow direction change events

Usage

find_changeEvents(x)

Arguments

x

A vector of flow values, should be sorted chronologically.

Details

This function accepts a vector of flow values, tests if each value in the flow vector is greater or less than the preceding value of flow, and classifies the flow vector into events. An event is defined as when a change in flow from one day to the next changes direction, e.g. rising limb to falling limb. If there is no change in flow from one day to the next it is considered part of the preceding event. If there is no change in flow for the whole timeseries, the timeseries is assigned event 0.

Value

A dataframe with columns "flow" and "event"

Examples

x <- sampleData$discharge
find_changeEvents(x)

USGS-R/EflowStats documentation built on Sept. 30, 2023, 9:31 p.m.