View source: R/rolling-slope.R
rolling_slope | R Documentation |
rolling_slope
calculates the first and second derivative
of a provided time series trend along with the moving average
of these values
rolling_slope(
data,
date_col,
value_col,
group_col = NULL,
model = c("ss", "gam", "loess"),
return_models = FALSE
)
data |
a dataframe or tbl that contains at the minimum a date column and a chlorine residual column |
date_col |
the unqouted name of the date column |
value_col |
the unquoted name of the chlorine residual column |
group_col |
vector of unqouted names of all grouping columns, if grouping is needed - e.g. if the dataset contains multiple sites and/or parameters. |
model |
the model type to use to estimate total chlorine trend. One of "ss" (smooth spline), "gam" (generalized additive model), or "loess" (Local Polynomial Regression) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.