View source: R/find_changeEvents.R
find_changeEvents | R Documentation |
Function to decompose a flow series into flow direction change events
find_changeEvents(x)
x |
A vector of flow values, should be sorted chronologically. |
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.
A dataframe with columns "flow" and "event"
x <- sampleData$discharge
find_changeEvents(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.