On Jan 9, 2006, at 3:35 PM, Kjetil Halvorsen wrote: > But this thread seems to have pointed to some inconsistencies: > >> cumprod( numeric(0) ) > numeric(0) >> cumsum( numeric(0) ) > numeric(0) > > shouldn't this give the same as prod() and sum() in this case?
No - as Thomas explained very nicely they are a different kind of functions. cumXXX are n-to-n length vector functions, whereas prod/ sum are n to 1 vector length functions. So R is in fact very consistent and Thomas did exactly describe the rules. Cheers, Simon ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel