@vsudbrack suggests that a running average function would be useful; he is doing:
function (float)running_mean(lif y, [integer$ window = 3])
{
half_window = asInteger(floor(window / 2));
y_mean = rep(NAN, length(y));
for (i in half_window:(length(y) - half_window - 1))
y_mean[i] = mean(y[(i - half_window):(i + half_window)]);
return y_mean;
}
R's filter() function would be perhaps good functionality to aim for, at least in part. Food for thought.
@vsudbrack suggests that a running average function would be useful; he is doing:
R's
filter()function would be perhaps good functionality to aim for, at least in part. Food for thought.