> Martin Maechler
> on Thu, 1 Feb 2018 16:34:04 +0100 writes:
> > Hervé Pagès
> > on Tue, 30 Jan 2018 13:30:18 -0800 writes:
>
> > Hi Martin, Henrik,
> > Thanks for the follow up.
>
> > @Martin: I vote for 2) without *any* hesitation :-)
>
> > (and unif
> Hervé Pagès
> on Tue, 30 Jan 2018 13:30:18 -0800 writes:
> Hi Martin, Henrik,
> Thanks for the follow up.
> @Martin: I vote for 2) without *any* hesitation :-)
> (and uniformity could be restored at some point in the
> future by having prod(), rowSums(), colSum
Hi Martin, Henrik,
Thanks for the follow up.
@Martin: I vote for 2) without *any* hesitation :-)
(and uniformity could be restored at some point in the
future by having prod(), rowSums(), colSums(), and others
align with the behavior of length() and sum())
Cheers,
H.
On 01/27/2018 03:06 AM,
> Henrik Bengtsson
> on Thu, 25 Jan 2018 09:30:42 -0800 writes:
> Just following up on this old thread since matrixStats 0.53.0 is now
> out, which supports this use case:
>> x <- rep(TRUE, times = 2^31)
>> y <- sum(x)
>> y
> [1] NA
> Warning message:
Just following up on this old thread since matrixStats 0.53.0 is now
out, which supports this use case:
> x <- rep(TRUE, times = 2^31)
> y <- sum(x)
> y
[1] NA
Warning message:
In sum(x) : integer overflow - use sum(as.numeric(.))
> y <- matrixStats::sum2(x, mode = "double")
> y
[1] 2147483648
>
Hi Martin,
On 06/07/2017 03:54 AM, Martin Maechler wrote:
Martin Maechler
on Tue, 6 Jun 2017 09:45:44 +0200 writes:
Hervé Pagès
on Fri, 2 Jun 2017 04:05:15 -0700 writes:
>> Hi, I have a long numeric vector 'xx' and I want to use
>> sum() to count the number of elements
> Martin Maechler
> on Tue, 6 Jun 2017 09:45:44 +0200 writes:
> Hervé Pagès
> on Fri, 2 Jun 2017 04:05:15 -0700 writes:
>> Hi, I have a long numeric vector 'xx' and I want to use
>> sum() to count the number of elements that satisfy some
>> criteria like non-
> Hervé Pagès
> on Fri, 2 Jun 2017 04:05:15 -0700 writes:
> Hi, I have a long numeric vector 'xx' and I want to use
> sum() to count the number of elements that satisfy some
> criteria like non-zero values or values lower than a
> certain threshold etc...
> The pr
I second this feature request (it's understandable that this and
possibly other parts of the code was left behind / forgotten after the
introduction of long vector).
I think mean() avoids full copies, so in the meanwhile, you can work
around this limitation using:
countTRUE <- function(x, na.rm =
Hi,
I have a long numeric vector 'xx' and I want to use sum() to count
the number of elements that satisfy some criteria like non-zero
values or values lower than a certain threshold etc...
The problem is: sum() returns an NA (with a warning) if the count
is greater than 2^31. For example:
>
10 matches
Mail list logo