rate_of_change {adc} | R Documentation |

## Approximate the Instantaneous Rate of Change

### Description

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.

### Usage

```
rate_of_change(discharge, dates, smooth = TRUE)
```

### Arguments

`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 |

### Value

Numeric vector with the estimated streamflow rate of change.

### Examples

```
## 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)
```

[Package

*adc*version 1.0.0 Index]