I'm using the xmr() function from the xmrr package. It allows you to set the interval to a specific number (defaults to 5) for calculating and recalculating averages, but I noticed that it doesn't keep that interval number. In my test run, it starts by using 5 values for the average, but then after the first recalculation it goes down to 4, then after another recalculation it goes down again to 3.
I've looked through the source code by using getAnywhere(xmr()), but the code is a bit beyond me. Would anyone know how to change the source code so that for every recalculation, it's using the same interval number consistently?
Thanks!
Example of code:
data_xmr = xmr(df = data,
measure = "Variable",
recalc = T, interval = 5,
shortrun = c(3,4),
longrun = c(8,8),
)
Example of xmr() output: enter image description here
However, E7:E12 should be (3.8+3.54+3.77+3.51+3.77)/5, but the xmr function calculates by taking (3.8+3.54+3.77+3.51)/4.
The same happens for E14:E16. It only uses an interval of 3 to calculate the central line average, instead of an interval of 5.