Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread William Dunlap
> if I want to use foo::bar many times, say > in a loop, I would do > > foo_bar <- foo::bar > > and use foo_bar, or something along those lines. The foreach package does that with a function from the compiler package, so that foreach can work on old version of R: comp <- if (getRversion() < "2.1

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread Peter Haverty
Hi all, I use Luke's "::" hoisting trick often. I think it would be fantastic if the JIT just did that for you. The main trouble, for me, is in code I don't own. When common Bioconductor packages are loaded many, many base functions are saddled with this substantial dispatch and "::" overhead.

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Achim Zeileis
On Thu, 22 Jan 2015, Max Kuhn wrote: On Thu, Jan 22, 2015 at 1:05 PM, Achim Zeileis wrote: On Thu, 22 Jan 2015, Max Kuhn wrote: On Thu, Jan 22, 2015 at 12:45 PM, Achim Zeileis wrote: On Thu, 22 Jan 2015, Max Kuhn wrote: I've had a lot of requests for additions to the reproducible resear

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread Michael Lawrence
On Thu, Jan 22, 2015 at 11:44 AM, wrote: > > For default methods there ought to be a way to create those so the > default method is computed at creation or load time and stored in an > environment. We had considered that, but we thought the definition of the function would be easier to interpret

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Max Kuhn
On Thu, Jan 22, 2015 at 1:05 PM, Achim Zeileis wrote: > On Thu, 22 Jan 2015, Max Kuhn wrote: > >> On Thu, Jan 22, 2015 at 12:45 PM, Achim Zeileis >> wrote: >>> >>> On Thu, 22 Jan 2015, Max Kuhn wrote: >>> I've had a lot of requests for additions to the reproducible research task view th

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread Henrik Bengtsson
On Thu, Jan 22, 2015 at 11:44 AM, wrote: > I'm not convinced that how to make :: faster is the right question. If > you are finding foo::bar being called often enough to matter to your > overall performance then to me the question is: why are you calling > foo::bar more than once? Making :: a bit

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread Tim Keitt
On Thu, Jan 22, 2015 at 1:44 PM, wrote: > I'm not convinced that how to make :: faster is the right question. If > you are finding foo::bar being called often enough to matter to your > overall performance then to me the question is: why are you calling > foo::bar more than once? Making :: a bit

Re: [Rd] :: and ::: as .Primitives?

2015-01-22 Thread luke-tierney
I'm not convinced that how to make :: faster is the right question. If you are finding foo::bar being called often enough to matter to your overall performance then to me the question is: why are you calling foo::bar more than once? Making :: a bit faster by making it a primitive will remove some

[Rd] :: and ::: as .Primitives?

2015-01-22 Thread Peter Haverty
Hi all, When S4 methods are defined on base function (say, "match"), the function becomes a method with the body "base::match(x,y)". A call to such a function often spends more time doing "::" than in the function itself. I always assumed that "::" was a very low-level thing, but it turns out to

[Rd] speedbump in library

2015-01-22 Thread Peter Haverty
Hi all, Profiling turned up a bit of a speedbump in the library function. I submitted a patch to the R bug tracker as bug 16168 and I've also included it below. The alternate code is simpler and easier to read/maintain, I believe. Any thoughts on other ways to write this? Index: src/library/base

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Achim Zeileis
On Thu, 22 Jan 2015, Max Kuhn wrote: On Thu, Jan 22, 2015 at 12:45 PM, Achim Zeileis wrote: On Thu, 22 Jan 2015, Max Kuhn wrote: I've had a lot of requests for additions to the reproducible research task view that fall into a grey area (to me at least). For example, roxygen2 is a tool that

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Max Kuhn
On Thu, Jan 22, 2015 at 12:45 PM, Achim Zeileis wrote: > On Thu, 22 Jan 2015, Max Kuhn wrote: > >> I've had a lot of requests for additions to the reproducible research >> task view that fall into a grey area (to me at least). >> >> For example, roxygen2 is a tool that broadly enable reproducibili

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Achim Zeileis
On Thu, 22 Jan 2015, Max Kuhn wrote: I've had a lot of requests for additions to the reproducible research task view that fall into a grey area (to me at least). For example, roxygen2 is a tool that broadly enable reproducibility but I see it more as a tool for better programming. I'm about to

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Luca Braglia
Hi, this summer, after few mails on this list, i started something similar (feeling the same need)... here is the repo https://github.com/lbraglia/PackageDevelopmentTaskView Currently it's quite freezed since i'm working on other projects in my free software spare time (and likely i won't return

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Henrik Bengtsson
On Thu, Jan 22, 2015 at 7:20 AM, Max Kuhn wrote: > I've had a lot of requests for additions to the reproducible research > task view that fall into a grey area (to me at least). > > For example, roxygen2 is a tool that broadly enable reproducibility > but I see it more as a tool for better program

Re: [Rd] Programming Tools CTV

2015-01-22 Thread Gregory R. Warnes
I second the motion for a Programming Tools CRAN Task View. I would also think it could contain things like Rcpp, R6, etc. -Greg > On Jan 22, 2015, at 10:20 AM, Max Kuhn wrote: > > I've had a lot of requests for additions to the reproducible research > task view that fall into a grey area (t

[Rd] R CMD check: Locale not set to C?

2015-01-22 Thread Tobias Setz
Dear All The "R CMD check" on the "zoo" (1.7-11) package results in an error on my environment. It can be reduced to the following example: > require(zoo) > read.zoo(system.file("doc", "demo1.txt", package = "zoo"), sep = "|", format="%d %b %Y"

[Rd] Programming Tools CTV

2015-01-22 Thread Max Kuhn
I've had a lot of requests for additions to the reproducible research task view that fall into a grey area (to me at least). For example, roxygen2 is a tool that broadly enable reproducibility but I see it more as a tool for better programming. I'm about to check in a new version of the task view

Re: [Rd] reducing redundant work in methods package

2015-01-22 Thread Michael Lawrence
Actually, after reading the comment about it being OK for it being NULL, it's not a bug after all. On Thu, Jan 22, 2015 at 5:57 AM, Michael Lawrence wrote: > I also just noticed that there is a bug: identical(ans, FALSE) should > be is.null(ans). > > So no error is thrown: >> methods:::genericFor

Re: [Rd] reducing redundant work in methods package

2015-01-22 Thread Michael Lawrence
I also just noticed that there is a bug: identical(ans, FALSE) should be is.null(ans). So no error is thrown: > methods:::genericForPrimitive("foo") NULL Will fix. On Wed, Jan 21, 2015 at 3:13 PM, Peter Haverty wrote: > Doing it like this: > > genericForPrimitive <- function(f, where = topenv(p