tbr_median: Time-Based Rolling Median

View source: R/tbr_median.R

tbr_medianR Documentation

Time-Based Rolling Median

Description

Produces a a rolling time-window based vector of medians and confidence intervals.

Usage

tbr_median(.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 median_ci

Value

tibble with columns for the rolling median and upper and lower confidence intervals.

See Also

median_ci

Examples

## Return a tibble with new rolling median column
tbr_median(Dissolved_Oxygen, x = Average_DO, tcolumn = Date, unit = "years",
n = 5)

## Not run: 
## Return a tibble with rolling median and 95% CI 
tbr_median(Dissolved_Oxygen, x = Average_DO, tcolumn = Date, unit = "years", n = 5, conf = .95)
## End(Not run)

mps9506/tbrf documentation built on May 20, 2022, 10:49 a.m.