find_events: Function to decompose a flow series into high or low flow...

View source: R/find_events.R

find_eventsR Documentation

Function to decompose a flow series into high or low flow events.

Description

This function accepts a vector of flow values, tests if each value in the flow vector is above or below a defined threshold, and classifies the flow vector into events. An event is defined as consecutive values above or below the given threshold.

Usage

find_events(x, threshold, type = "high")

Arguments

x

A numeric vector of flow values

threshold

Numeric threshold value defining event

type

character indicating type of event. High flags events above threshold, low flags events below threshold.

Value

A dataframe with columns "flow" and "event"

Examples

x <- sampleData$discharge
threshold <- median(x,na.rm=TRUE)
find_events(x,threshold)

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