Displaying 1 result from an estimated 1 matches for "rollappy".
Did you mean:
rollapply
2012 Jul 10
1
Help with vectors and rollapply
...all zeros into previous non-zero state. So for instance the above vector should be converted into:
a= (-2,-2,-2,-2,1,1,1,3,3,3,-4)
I tried many things and finally concluded that probably(?) rollapply may be the best way?
I tried
f= function(x){
ifelse(x==0,Lag(x),x)
}
And then, rollappy(a,1,f) and that didn't work. Can someone help please?
Thx
R
Jefferies archives and monitors outgoing and incoming e-mail. The contents of this email, including any attachments, are confidential to the ordinary user of the email address to which it was addressed. If you are not the addressee...