xmR_variant: Generate the XMR data for any time-series data.

Description Usage Arguments Examples

View source: R/xmr_variant.R

Description

Will be used to calculate XMR data using the "weco" rules.

Usage

1
xmR_variant(df, measure, interval, recalc, testing)

Arguments

df

The dataframe containing the time-series data. Must be in tidy format. At least 1 variable for time and one variable for measure.

measure

The column containing the measure. Must be in numeric format.

interval

The interval you'd like to use to calculate the averages. Defaults to 5.

recalc

Logical if you'd like it to recalculate bounds. Defaults to False

Long Runs - 8 consecutive points above or below the central line and after the initial 5 points. If a long run is present, then use the first 5 points to recalculathe new bounds, after which these points are never to be used again. These newly calculated bounds begin at the first point in the long run and extend to the end of the chart, unless re-calculated after the end of the run. If the long run is longer than 8 points, it should still be enveloped by the bounds of normal variation to be re-calculated.

Short Runs - 2 of 3 points that are closer to either bound than they are to the central line and after the initial 5 points. If a short run is made by points not previously used in a calculation, then use those points to calculate new bounds and exclude them from any further calculations. A single point may be used in two calculations if Like long runs, these newly calculated bounds begin at the first point in the short run, and extend to the end of the chart unless re-calculated after the end of the run.

Examples

1
2
3
4
5
6
dat.xmr <- xmR_variant(dat, "Measure", 5)
dat.xmr <- dat %>% 
          group_by(., Program, Variable) %>% 
          do(xmR_variant(., measure = "Retention Rate", 
          interval = 5, recalc = T))           
xmR_chart(., "Time", "Measure", "Facet")

Zanidean/sRa documentation built on May 7, 2019, 7:44 a.m.