similar to: bquote/evalq behavior changed in R-3.2.1

Displaying 20 results from an estimated 5000 matches similar to: "bquote/evalq behavior changed in R-3.2.1"

2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
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 stored in "fenv," but it is when I run the same code on 3.2.1. However, the given
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
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 results in the x object not being stored in fenv on 3.1.2. Dayne On Wed, Jul 15, 2015 at 4:40 PM,
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
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 rapply's code in both version was: if (typeof(object) != "list")
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
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 = if (is.list(envir) || : object 'myNumber' not found lapply(list(quote(1+myNumber)),
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
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 <dayne.filer at gmail.com> wrote: > 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.
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
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 3.1.3 (2015-03-09) R version 3.2.0 (2015-04-16) [1,] [1]
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
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 <dayne.filer at gmail.com> 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
2007 May 27
2
Question about "evalq"
The help page of eval says: The 'evalq' form is equivalent to 'eval(quote(expr), ...)'. But the following is not equivalent. Can anyone give me some explaination? Thanks very much. > f1 <- function(x,digits=5) lapply(x, f2) > f2 <- function(x) eval(quote(print(x+1,digits=digits)),list(x=x),parent.frame(2)) > f1(list(x1=1)) [1] 2 $x1 [1] 2 > > f1 <-
2007 May 18
1
subset arg in (modified) evalq
Hi, When using evalq to evaluate expressions within a say data.frame context I often wish there was a 'subset' argument, much like in lm() or any ather advanced regression model. I would be grateful for a tip how to do this. Here is an illustration of what I want: n <- 100 data <- data.frame(x=rnorm(n), y=rnorm(y), z=rnorm(z)) # this works evalq({ i <- 0<x;
2015 Jan 26
2
Inspect a "delayed" assigned whose value throws an error?
On Mon, Jan 26, 2015 at 12:24 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > If it was any other environment than the global, you could use substitute: > > e <- new.env() > delayedAssign("foo", stop("Hey!"), assign.env = e) > substitute(foo, e) > > delayedAssign("foo", stop("Hey!")) > substitute(foo) Hmm... interesting
2020 Jun 01
1
eval and Calling Frames
I ran into an interesting issue with `evalq` (and also `eval(quote(...))`): ???? f <- function() { ?????? list( ???????? sys.parent(1), ???????? evalq(sys.parent(1)), ???????? evalq((function() sys.parent(2))()),? # add an anon fun layer ???????? evalq((function() sys.parent(1))()) ?????? ) ???? } ???? res <- f() ???? str(res) ???? ## List of 4 ???? ##? $ : int 0???????? # sys.parent(1)
2015 Apr 01
4
evaluation in transform versus within
On 01/04/2015 1:35 PM, Gabriel Becker wrote: > Joris, > > > The second argument to evalq is envir, so that line says, roughly, "call > environment() to generate me a new environment within the environment > defined by data". I think that's not quite right. environment() returns the current environment, it doesn't create a new one. It is evalq() that created
2018 Jan 19
1
IBM Power vs Markdown
Hi, folks. I was wondering if any of you could point me in the right direction. Using R 3.3.3 (and later), on an IBM Power LPAR, Red Hat 7 PPC64le, markdown build fails as below. > install.packages("markdown") trying URL 'https://cloud.r-project.org/src/contrib/markdown_0.8.tar.gz' Content type 'unknown' length 80583 bytes (78 KB)
2015 Jan 14
2
Is the tcltk failure in affylmGUI related to R bug 15957
I maintain the package affylmGUI. It works when installed on many previous versions of R. I have today tested exactly the same code under R-2.15.3, R-3.0.2, R-3.1.0, R-3.1.1, R-3.1.2 and R-devel. I have also tested the versions of affylmGUI downloaded by biocLite for each version of R and the same result applies. I have no errors under 2.15.3, 3.0.2, 3.1.0 and 3.1.1. The following error
2010 Jan 25
2
Two == expressions in bquote
Hi, I want to put text on a plot containing something like: a = b^2 = <squared numeric value of b> using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2)) # This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(delta == mu^2 == .(mu^2))) # This doesn't work The last text function returns the error:
2009 Jan 28
1
evaluation revisited
I'm still going over old emails and trying to get my head around evaluation so I'm persistent if nothing else. A while back , an expert sent me below as an exercise in understanding and I only got around to it tonight. I understand some of the output but not all of it and I put "Why not Zero ?" next to the ones that I don't understand based on my reading of the various
2001 Oct 16
4
Assignment of structures on a given environment
Hi, In order to avoid deep copies by passing large arguments to functions or returning values, I'm trying to do the assignment of variables in a given environment. The problem is when I try to assign a structure: a list for example. If I have: ind <- c("a","b") my idea is doing something like l <- alist() l[ind] <- as.list(c(20,40)) in a given
2008 Oct 02
1
using bquote to construct function
Hi, R-help, (sessionInfo at the end) I'm trying to construct a function using bquote and running into a strange error message. As an example, what I would like to do is this: z <- 2 eval(bquote(function(x, y) { x^.(z) + y }))(2, 3) However, I get the following: Error in eval(expr, envir, enclos) : invalid formal argument list for "function" However, if I change the
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi, I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. This code works> main= bquote(paste("Results for ", beta ==.(b1)) but I also need the index 3. I tried (simplified): >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) and a few other versions, but I can not get it to run properly. Any help would
2002 Sep 04
3
strange things with eval and parent frames
Dear mailing list, I have found some strange behaviour which I think relates to parent frames and eval. Can anyone explain what's going on here? First example: > test.parent.funcs_ function() { outer.var_ 5 subfunc1_ function() substitute( outer.var, envir=parent.frame()) print( subfunc1()) subfunc2b_ function() eval( quote( outer.var), envir=parent.frame()) print(