I have an Integer overflow error with the rollmean function. It's working well when I am doing it on 5 numbers section but not working on a 20 (and 260) number sections.
Numbers are trading volumes (7 digits).
Do you have any clue to solve this problem?
thanks
SP_stock$mean_vol_20<-ave(SP_stock$vol, SP_stock$ticker, FUN=function(x) rollmean(x,k=20, na.pad=T, align="right"))
Error: In sum(xu[1:k]) : dépassement d'entier - utiliser sum(as.numeric(.))
Error: In sum(xu[1:k]) : Integer overflow - use sum(as.numeric(.))