clip_flow: Clip flow measurements to zero when no rain has fallen

Description Usage Arguments Value

View source: R/clip_flow.R

Description

The flumes that measure flow sometimes get stuck. This is clear when there has been no rainfall recently, but the flume is still recording flow. When this occurs, we set the flow to zero. This function sorts the data.frame by date_time and then calculates the max rain in the previous window rows of the data.frame (ignoring NAs). If this max is zero, then flow is set to zero.

Usage

1
clip_flow(data, window = 24 * 60)

Arguments

data

A data.frame containing columns date_time, flow, and rain.

window

An integer indicating the number of minutes to calculate the max rain over. Default is 24*60, the number of minutes in a day.

Value

A data.frame arranged by date_time with the flow column updated so that flow is 0 when no rain has fallen.


jarad/HelmersLab documentation built on Dec. 5, 2020, 8:34 a.m.