Re: [R] Best way to compute a sum

From: Peter Langfelder <>
Date: Thu, 24 Jun 2010 13:57:11 -0700

On Thu, Jun 24, 2010 at 1:50 PM, Duncan Murdoch <> wrote:
> On 24/06/2010 4:39 PM, Peter Langfelder wrote:
>> AFAIK the optimal way of summing a large number of positive numbers is
>> to always add the two smallest numbers
> Isn't that what I said?

I understood that you suggested to linearly sum the numbers from the smallest to the largest. That would take an initial sort and then a simple sum. My idea is to keep the order throughout. Apologies if I misunderstood.

Peter mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 Jun 2010 - 20:59:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jun 2010 - 21:40:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive