Re: [Rd] What algorithm is R using to calculate mean?

2013-07-26 Thread Ravi Varadhan
This uses the idea of Kahan's summation, if I am not mistaken. http://en.wikipedia.org/wiki/Kahan_summation_algorithm Ravi From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf of Joshua Ulrich [josh.m.ulr...@gmail.com] Sent: Frid

Re: [Rd] What algorithm is R using to calculate mean?

2013-07-26 Thread Zach Harrington
I don't believe this is Kahan summation (which I looked at while trying to track this down). Kahan summation seems to work by attempting to capture the error in each accumulation to the sum, then adding it back to the next element before it is accumulated to the sum. I believe the R algorithm w

Re: [Rd] How to best implement package options?

2013-07-26 Thread Simon Urbanek
On Jul 26, 2013, at 9:59 AM, Bjørn-Helge Mevik wrote: > Dear developeRs, > > I have a package, pls, that implements package options. The users are > supposed to use a function pls.options() to manipulate them. > > If a user changes the options, they are stored in .GlobalEnv. I was > recently

[Rd] How to best implement package options?

2013-07-26 Thread Bjørn-Helge Mevik
Dear developeRs, I have a package, pls, that implements package options. The users are supposed to use a function pls.options() to manipulate them. If a user changes the options, they are stored in .GlobalEnv. I was recently informed that this is against current CRAN submission policies, so I n

Re: [Rd] Building R with Cairo

2013-07-26 Thread Dirk Eddelbuettel
| On 25/07/2013 20:35, Ben Warren wrote: | > I have been hacking on an R 2.15 build on an Ubuntu 10.4 box, and I do | > not know how to debug R's error message regarding cairo "working". Well -- there is a formally supported package so you could just use what I use in the official Debian /

Re: [Rd] What algorithm is R using to calculate mean?

2013-07-26 Thread Joshua Ulrich
This was also asked on StackOverflow: http://stackoverflow.com/q/17866149/271616. Here is the answer I posted: This appears to be the updating method of West, 1979 [1] and it was implemented in R-2.3.0 in response to PR#1228 [2]. I'm not positive this is the correct algorithm, since it was sugge

Re: [Rd] Building R with Cairo

2013-07-26 Thread Prof Brian Ripley
On 25/07/2013 20:35, Ben Warren wrote: All- I have been hacking on an R 2.15 build on an Ubuntu 10.4 box, and I do not know how to debug R's error message regarding cairo "working". Configuration completes without the expected additional capability (cairo) We don't support obsolete ver

[Rd] What algorithm is R using to calculate mean?

2013-07-26 Thread Zach Harrington
I am curious to know what algorithm R's mean function uses. Is there some reference to the numerical properties of this algorithm? I found the following C code in summary.c:do_summary(): case REALSXP: PROTECT(ans = allocVector(REALSXP, 1)); for (i = 0; i < n; i++) s += REAL(x)[i]; s

[Rd] Building R with Cairo

2013-07-26 Thread Ben Warren
All- I have been hacking on an R 2.15 build on an Ubuntu 10.4 box, and I do not know how to debug R's error message regarding cairo "working". Configuration completes without the expected additional capability (cairo) R is now configured for x86_64-unknown-linux-gnu > Source directory: