[R] runmax function only for positive numbers?

Duncan Murdoch murdoch at stats.uwo.ca
Wed Aug 12 10:39:52 CEST 2009

Jiucang Hao wrote:
> Hi All,
>     I did a google search and could not find the answer. Thus I post this
> message. I found runmax only work for positive numbers.
> x = rep(-1,10)  
> runmax(x,3)
> x = rep(0, 10)
> runmax(x,3)
> for 32-bit R, i got very small numbers:  2.121996e-314
> for 64-bit R, i got NaN. 
> Is it a bug in runmax? or should this be included in the documentation that
> runmax only for positive numbers?
> however, we do have a workaround -- runmin works, thus we can do y =
> -runmin(-x,3).

You are talking about runmax in the caTools package?  You should let the 
maintainer know.  I've cc'd him in this message.

Duncan Murdoch

More information about the R-help mailing list