Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread William Dunlap
You could test for the version of R when using rapply. > getRversion() >= "3.2.0" [1] TRUE I rarely use rapply(). I often find that writing my own purpose-built recursive function is easier than fitting my problem into rapply's framework. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Dayne Filer
Bill, Is your conclusion to just update the code and enforce using the most recent version of R? Dayne On Wed, Jul 15, 2015 at 4:44 PM, Dayne Filer wrote: > David, > > If you are referring to the solution that would be: > > rapply(list(test), eval, envir = fenv) > > I thought I explained in th

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Dayne Filer
David, If you are referring to the solution that would be: rapply(list(test), eval, envir = fenv) I thought I explained in the question that the above code does not work. It does not throw an error, but the behavior is no different (at least in the output or result). Using the above code still r

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread William Dunlap
Another aspect of the change is (using TERR's RinR package): > options(REvaluators=list(makeREvaluator("R-3.1.3"), makeREvaluator("R-3.2.0"))) > RCompare(rapply(list(quote(function(x)x),list(quote(pi),quote(7-4))), function(arg)typeof(arg))) R version

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread David Winsemius
On Jul 15, 2015, at 12:51 PM, William Dunlap wrote: > I think rapply() was changed to act like lapply() in this respect. > When I looked at the source of the difference, it was that typeof() returned 'language' in 3.2.1, while it returned 'list' in the earlier version of R. The first check in

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread William Dunlap
I think rapply() was changed to act like lapply() in this respect. In R-3.1.3 we got rapply(list(quote(1+myNumber)), evalq, envir=list2env(list(myNumber=17))) #[1] 18 rapply(list(quote(1+myNumber)), eval, envir=list2env(list(myNumber=17))) #Error in (function (expr, envir = parent.frame(), enclos

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Kevin Ushey
My best guess is that it could be related to this commit: https://github.com/wch/r-source/commit/14f904c32a44010d4dfb8a829805648a88c22f53, since that's the only change that's touched `rapply` lately. On Wed, Jul 15, 2015 at 12:35 PM, Dayne Filer wrote: > In 3.1.2 eval does not store the result of

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Dayne Filer
In 3.1.2 eval does not store the result of the bquote-generated call in the given environment. Interestingly, in 3.2.1 eval does store the result of the bquote-generated call in the given environment. In other words if I run the given example with eval rather than evalq, on 3.1.2 "x" is never stor

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread William Dunlap
I am curious why you used evalq instead of eval in this code. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jul 15, 2015 at 11:49 AM, Dayne Filer wrote: > Hello, > > I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked > as I intended previously. Briefly, I am using

Re: [Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Duncan Murdoch
On 15/07/2015 2:49 PM, Dayne Filer wrote: > Hello, > > I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked > as I intended previously. Briefly, I am using bquote to generate > expressions to modify data.table objects within a function, so I need the > changes to actually be

[Rd] bquote/evalq behavior changed in R-3.2.1

2015-07-15 Thread Dayne Filer
Hello, I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked as I intended previously. Briefly, I am using bquote to generate expressions to modify data.table objects within a function, so I need the changes to actually be stored in the given environment. Previously, I used c