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
--
--
On Sat, May 16, 2015 2:33 PM BST Marc Schwartz wrote:
>
>> On May 16, 2015, at 6:11 AM, Hin-Tak Leung
>> wrote:
>>
>>
>>
>> --
>> On Sat, May 16, 2015 8:04 AM BST Uwe Ligges wrote:
>>
>> Not sure why this goes to R-devel. You just co
I've noticed that install.packages()
[https://svn.r-project.org/R/trunk/src/library/utils/R/packages.R] and
update.packages()
[https://svn.r-project.org/R/trunk/src/library/utils/R/packages2.R]
sometimes output to stdout and sometimes to stderr.
It looks like stderr is used (e.g. via cat()) when t
Below is some further troubleshooting on this:
>From code inspection this bug happens for only:
* for integer values
* when the first element is NA_integer_ and the second is not.
Examples:
# Numeric/doubles works as expected
> cummax(c(NA_real_, 0, 1, 2, 3))
[1] NA NA NA NA NA
# It does not