[R] How do I fix this ?

Pete Brecknock Peter.Brecknock at bp.com
Thu Jan 27 04:55:37 CET 2011


Your problem lies in the way cumprod deals with NAs

If you look at ?cumprod you will see 
"An NA value in x causes the corresponding and following elements of the
return value to be NA"

Not sure what behaviour you want to see on encountering an NA (ignore it,
restart the cumprod process, .....). Making things easy for myself (it's
late), if you wish to simply ignore an NA the following would work

# sample data

# ignore NA




View this message in context: http://r.789695.n4.nabble.com/How-do-I-fix-this-tp3239239p3241432.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list