Re: [R] Best way to compute a sum

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

On Thu, Jun 24, 2010 at 1:50 PM, Duncan Murdoch <murdoch.duncan_at_gmail.com> 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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive