Re: [Rd] code for sum function

2019-02-20 Thread Tomas Kalibera
Dear Rampal, you can download R source code in form of a tarball or from subversion, please see https://cran.r-project.org/doc/manuals/R-admin.html#Obtaining-R https://cran.r-project.org/doc/manuals/R-admin.html#Using-Subversion-and-rsync There is also a web access to subversion, so specifically

[Rd] model.matrix.default() silently ignores bad contrasts.arg

2019-02-20 Thread Ben Bolker
An lme4 user pointed out that passing contrasts as a string or symbol to [g]lmer (which would work if we were using `contrasts<-` to set contrasts on a factor variable) is *silently ignored*. This goes back to model.matrix(), and seems bad (this is a very e

Re: [Rd] code for sum function

2019-02-20 Thread William Dunlap via R-devel
Someone said it used a possibly platform-dependent higher-than-double-precision type. By the way, in my example involving rep(1/3, n) I neglected to include the most precise way to calculate the sum: n%/%3 + (n%%3)/3. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Feb 20, 2019 at 2:45 PM

Re: [Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-20 Thread Toby Hocking
Update: I have observed that stringi::stri_sub is linear time complexity, and it computes the same thing as base::substring. figure https://github.com/tdhock/namedCapture-article/blob/master/figure-substring-bug.png source: https://github.com/tdhock/namedCapture-article/blob/master/figure-substring

[Rd] Bug: time complexity of substring is quadratic as string size and number of substrings increases

2019-02-20 Thread Toby Hocking
Hi all, (and especially hi to Tomas Kalibera who accepted my patch sent yesterday) I believe that I have found another bug, this time in the substring function. The use case that I am concerned with is when there is a single (character scalar) text/subject, and many substrings to extract. For exam

Re: [Rd] Documentation for sd (stats) + suggestion

2019-02-20 Thread PatrickT
Indeed. Thanks for your suggestions. To elaborate briefly. The ``quantile`` function offers 9 types of methods. The ``sd`` function only one. The ``mad`` function offers ways to tweak the bias correction. The ``sd`` function doesn't. Are there good reasons against adding features to ``sd``? after

Re: [Rd] Documentation for sd (stats) + suggestion

2019-02-20 Thread PatrickT
Oh thanks, missed that. I expected the explanation to be near the top under "Description." I may have scanned for the word "sample", which doesn't appear. I could have searched harder. Apologies for the noise. On Tue, Feb 19, 2019 at 5:59 PM S Ellison wrote: > > As far as I can tell, the manual

Re: [Rd] patch for gregexpr(perl=TRUE)

2019-02-20 Thread Tomas Kalibera
Thanks, in R-devel 76138, I confirm it speeds up gregexpr() with pcre in Bill Dunlap's example from https://stat.ethz.ch/pipermail/r-devel/2017-January/073577.html (RegExprPCRE column) The performance problem of StrSplitPCRE does not seem to be due to strlen(). Best Tomas On 2/19/19 9:37 PM, T

Re: [Rd] make.unique rbind examples

2019-02-20 Thread Jonathan Carroll
Entirely by coincidence I just now discovered that this issue was raised in 2013 [1] with similar suggestions for improvements. My search did not initially uncover this message, so apologies for the repost which was actually a nearly 16 year later "bump" posting. [1] https://stat.ethz.ch/pipermail

Re: [Rd] code for sum function

2019-02-20 Thread Berend Hasselman
> > On 2019-02-19 2:08 p.m., William Dunlap via R-devel wrote: >> The algorithm does make a differece. You can use Kahan's summation >> algorithm (https://en.wikipedia.org/wiki/Kahan_summation_algorithm) to >> reduce the error compared to the naive summation algorithm. E.g., in R >> code: >> >>

Re: [Rd] Compile R to WebAssembly / Emscripten?

2019-02-20 Thread Gábor Csárdi
This was some time ago: https://stat.ethz.ch/pipermail/r-devel/2013-May/066724.html So probably not hopeless, but I would think it is a lot of work. Gabor On Wed, Feb 20, 2019 at 8:17 AM Todd Wilder wrote: > > Has anyone attempted to compile R (probably without any OS bindings) to > WebAssembly

[Rd] Compile R to WebAssembly / Emscripten?

2019-02-20 Thread Todd Wilder
Has anyone attempted to compile R (probably without any OS bindings) to WebAssembly / Emscripten? If so, how far did you get? (would be crazy awesome if you could get all the way to a ggplot bitmap output). If not, is this a waste of time or is there some daylight to doing this? [[alternat