Skip to contents

Make rolling MAD (median absolute deviation) values for dataframe attribute.

Usage

ts_mad(data, window = 20)

Arguments

data

a data frame with a timerseries attribute - attribute must be named value to work

window

an integer indicating width of window

Value

a dataframe with rolling MAD statistic attribute

Examples


if (FALSE) { # \dontrun{
test_data = data.frame(index = 1:53,
                      value = c(rnorm(25, 10, 3)
                                ,rnorm(3, 100, 3)
                                ,rnorm(25, 10, 3)))
test_data %>%
 ts_mad(window = 7)
 } # }