rate_of_change {adc} | R Documentation |
Estimate the rate of change or first derivative of the raw mean daily streamflow or the smoothed cubic spline fit between time and mean daily streamflow.
rate_of_change(discharge, dates, smooth = TRUE)
discharge |
numeric vector of mean daily discharges |
dates |
vector of dates corresponding to daily discharge measurements.
Must be class |
smooth |
logical indicating if the first derivative is calculated using a cubic smoothing spline function. Defaults is |
Numeric vector with the estimated streamflow rate of change.
## calculate the first deriv of the smoothed function between Date and streamflow
rate <- rate_of_change(lavaca$Flow, lavaca$Date)
head(rate)
## Return the first deriv on raw measurements
rate2 <- rate_of_change(lavaca$Flow, lavaca$Date, smooth = FALSE)
head(rate2)