tbr_mean {tbrf} | R Documentation |
Time-Based Rolling Mean
Description
Produces a a rolling time-window based vector of means and confidence intervals.
Usage
tbr_mean(.tbl, x, tcolumn, unit = "years", n, ...)
Arguments
.tbl |
a data frame with at least two variables; time column formatted as date, date/time and value column. |
x |
column containing the numeric values to calculate the mean. |
tcolumn |
formatted time column. |
unit |
character, one of "years", "months", "weeks", "days", "hours", "minutes", "seconds" |
n |
numeric, describing the length of the time window. |
... |
additional arguments passed to |
Value
tibble with columns for the rolling mean and upper and lower confidence intervals.
See Also
Examples
## Return a tibble with new rolling mean column
tbr_mean(Dissolved_Oxygen, x = Average_DO, tcolumn = Date, unit = "years", n = 5)
## Not run:
## Return a tibble with rolling mean and 95% CI
tbr_mean(Dissolved_Oxygen, x = Average_DO, tcolumn = Date, unit = "years", n = 5, conf = .95)
## End(Not run)
[Package tbrf version 0.1.5 Index]