Skip to content
Prev 342970 / 398506 Next

dynamic runSum

On Thu, Aug 7, 2014 at 9:32 AM, amarjit chandhial
<a.chandhial at btinternet.com> wrote:
The width argument in rollapplyr in the zoo package can be a vector.
It can't be NA though so we have used 1 in those cases here and at the
end used na.omit to get rid of the junk at the beginning:

na.omit(rollapplyr(acf1, ifelse(is.na(acf1$VL), 1, acf1$VL), sum))