[Rd] The function cummax() seems to have a bug.

Dongcan Jiang dongcan.jiang at gmail.com
Sun May 17 13:13:51 CEST 2015


Hi,

The function cummax() seems to have a bug.

> x <- c(NA, 0)
> storage.mode(x) <- "integer"
> cummax(x)
[1] NA  0

The correct result of this case should be NA NA. The mistake in [
https://github.com/wch/r-source/blob/trunk/src/main/cum.c#L130-L136] may be
the reason.

Best Regards,
Dongcan

-- 
Dongcan Jiang
Team of Search Engine & Web Mining
School of Electronic Engineering & Computer Science
Peking University, Beijing, 100871, P.R.China

	[[alternative HTML version deleted]]



More information about the R-devel mailing list