similar to: evaluating variables in the context of a data frame

Displaying 20 results from an estimated 3000 matches similar to: "evaluating variables in the context of a data frame"

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)
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
2009 Mar 14
1
[LLVMdev] setting up LLVM to *run on* amd64 but *generate code* for alpha
On Fri, Mar 13, 2009 at 6:09 PM, Bill Wendling <isanbard at gmail.com> wrote: > On Fri, Mar 13, 2009 at 4:41 PM, Zack Weinberg <zackw at panix.com> wrote: >> I'm trying to persuade llvm (svn trunk) to build in a mode where it >> *runs on* amd64 but *generates code* for alpha, exclusively. ... >>  - The "natural" way to do that (by which I mean
2011 Jan 05
11
[Bug 32855] New: Incorrect image stretching with Render in RepeatPad mode, NV50
https://bugs.freedesktop.org/show_bug.cgi?id=32855 Summary: Incorrect image stretching with Render in RepeatPad mode, NV50 Product: xorg Version: git Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Driver/nouveau
2015 Aug 20
10
[Bug 91705] New: [NVE7] GPU crash (read fault) on boot w/ DMI+HDMI outputs
https://bugs.freedesktop.org/show_bug.cgi?id=91705 Bug ID: 91705 Summary: [NVE7] GPU crash (read fault) on boot w/ DMI+HDMI outputs Product: xorg Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component:
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
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
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 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
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 <-
2015 Apr 01
1
evaluation in transform versus within
On 01/04/2015 2:33 PM, Joris Meys wrote: > Thank you for the insights. I understood as much from the code, but I > can't really see how this can cause a problem when using with() or > within() within a package or a function. The environments behave like > I would expect, as does the evaluation of the arguments. The second > argument is supposed to be an expression, so I
2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
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 code like the following: test <- list(bquote(x <- 10)) fenv <- environment() rapply(test,
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
2009 Mar 14
9
[LLVMdev] setting up LLVM to *run on* amd64 but *generate code* for alpha
I'm trying to persuade llvm (svn trunk) to build in a mode where it *runs on* amd64 but *generates code* for alpha, exclusively. (Well, technically, generate code for my experimental architecture simulator that happens to be based on alpha.) I have been unable to find any combination of configure switches that makes this happen. I should probably underline that I am _not_ trying to
2007 Jun 08
2
wrapping lattice xyplot
This is an expanded version of the question I tried to ask last night - I thought I had it this morning, but it's still not working and I just do not understand what is going wrong. What I am trying to do is write a wrapper for lattice xyplot() that passes a whole bunch of its secondary arguments, so that I can produce similarly formatted graphs for several different data sets. This is what
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(
2015 Apr 01
2
evaluation in transform versus within
Dear list members, I'm a bit confused about the evaluation of expressions using with() or within() versus subset() and transform(). I always teach my students to use with() and within() because of the warning mentioned in the helppages of subset() and transform(). Both functions use nonstandard evaluation and are to be used only interactively. I've never seen that warning on the help
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
2007 Jun 08
1
still trying to wrap xyplot - ignore previous
As you may not be surprised to hear, no sooner did I post the previous message than I realized I had a really dumb mistake. I've now gotten a bit farther but am still stuck. New code: graph <- function (x, data, groups, xlab) { pg <- function(x, y, group.number, ...) fnord body(pg) <- substitute({ panel.xyplot(x, y, ..., group.number=group.number) panel.text(2,