search for: envir

Displaying 20 results from an estimated 1699 matches for "envir".

2017 May 09
3
R-3.3.3/R-3.4.0 change in sys.call(sys.parent())
...uspect it used in "lattice" as well. This idiom has not done good things for quite a while (ever?) but I noticed while running tests that it acts differently in R-3.4.0 than in R-3.3.3. Neither the old or new behavior is nice. E.g., in R-3.3.3 we get > parseEval <- function(text, envir) eval(parse(text=text), envir=envir) > parseEval('lattice::xyplot(mpg~hp, data=datasets::mtcars)$call', envir=new.env()) xyplot(expr, envir, enclos) and > evalInEnvir <- function(call, envir) eval(call, envir=envir) > evalInEnvir(quote(lattice::xyplot(mpg~hp, data=datasets::mt...
2017 May 11
1
R-3.3.3/R-3.4.0 change in sys.call(sys.parent())
...> This idiom has not done good things for quite a while (ever?) but I > noticed > > while running tests that it acts differently in R-3.4.0 than in R-3.3.3. > > Neither the old or new behavior is nice. E.g., in R-3.3.3 we get > > > >> parseEval <- function(text, envir) eval(parse(text=text), envir=envir) > >> parseEval('lattice::xyplot(mpg~hp, data=datasets::mtcars)$call', > > envir=new.env()) > > xyplot(expr, envir, enclos) > > > > and > > > >> evalInEnvir <- function(call, envir) eval(call, envir=envir...
2019 Aug 15
1
Rf_defineVar(symbol, R_UnboundValue, environment) questions
While poking around the C++ code in the dplyr package I ran across the idiom Rf_defineVar(symbol, R_UnboundValue, environment) to [sort of] remove 'symbol' from 'environment' Using it makes the R-level functions objects(), exists(), and get() somewhat inconsistent and I was wondering if that was intended. E.g., use SHLIB to make something from the following C code that dyn.load can load into R %...
2011 Nov 24
1
capture.output(eval(..., envir)) not evaluate in the expected(?) environment
I've noticed the following oddity where capture.output() prevents eval() from evaluating an expression in the specified environment. I'm not sure if it is an undocumented feature or a bug. It caused me many hours of troubleshooting. By posting it here, it might save someone else from doing the same exercise. Start by defining foo() which evaluates an expression locally in a given environment and catches the output...
2006 Apr 10
0
get(name, envir=envir) : formal argument "envir" matched by multiple actual arguments
Hi, very sporadic and non-reproducible, I get the following type of errors: Error in get(name, envir = envir) : formal argument "envir" matched by multiple actual arguments Error in exists(cacheName, envir = envir, inherit = FALSE) : formal argument "envir" matched by multiple actual arguments Error in paste(..., sep = sep) : formal argument "sep" matched by multipl...
2012 Jun 21
1
install package mixdist
..."mixdist") But I'm getting the following errors: * installing *source* package ‘mixdist’ ... ** R ** data ** preparing package for lazy loading ** help *** installing help indices ** building package indices ... Warning in utils::data(list = f, package = package, lib.loc = lib.loc, envir = dataEnv) : data set 'bindat.txt' not found Warning in utils::data(list = f, package = package, lib.loc = lib.loc, envir = dataEnv) : data set 'binpar.txt' not found Warning in utils::data(list = f, package = package, lib.loc = lib.loc, envir = dataEnv) : data set 'cassie.txt...
2012 May 15
1
Error in eval(expr, envir, enclos) : object 'Rayos' not found???
Hi R-listers, I am trying to make a trellis boxplot with the HSuccess (y-axis) in each Rayos (beach sections) (x-axis), for each Aeventexhumed (A, B, C) - nesting event. I am not able to do so and keep receiving: Error in eval(expr, envir, enclos) : object 'Rayos' not found Please advise, Jean require(plyr) resp <- read.csv("ABC Arribada R File Dec 12 Jean Jang.csv") envir <- read.csv("Responses Environ. Arribada Dec. 12.csv") resp <- resp[!is.na(resp$Aeventexhumed), ] resp$QuadratEv...
2008 Oct 14
1
library MICE warning message
...al 10: In any(predictorMatrix[j, ]) ... : coercing argument of type 'double' to logical 11: In any(predictorMatrix[, j]) ... : coercing argument of type 'double' to logical 12: In any(predictorMatrix[j, ]) ... : coercing argument of type 'double' to logical 13: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 14: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 15: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 16: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm!...
2010 Jan 20
1
R.oo installation warnings?
...* building package indices ... * DONE (R.methodsS3) > > tools:::.install_packages() * installing *source* package ?R.oo? ... ** R ** inst ** preparing package for lazy loading R.methodsS3 v1.1.0 (2010-01-02) successfully loaded. See ?R.methodsS3 for help. Warning in setGenericS3.default(name, envir = envir, validators = validators) : Renamed the preexisting function attach to attach.default, which was defined in environment base. Warning in setGenericS3.default(name, envir = envir, validators = validators) : Renamed the preexisting function detach to detach.default, which was defined in e...
2017 May 11
0
R-3.3.3/R-3.4.0 change in sys.call(sys.parent())
...tice" as well. > > This idiom has not done good things for quite a while (ever?) but I noticed > while running tests that it acts differently in R-3.4.0 than in R-3.3.3. > Neither the old or new behavior is nice. E.g., in R-3.3.3 we get > >> parseEval <- function(text, envir) eval(parse(text=text), envir=envir) >> parseEval('lattice::xyplot(mpg~hp, data=datasets::mtcars)$call', > envir=new.env()) > xyplot(expr, envir, enclos) > > and > >> evalInEnvir <- function(call, envir) eval(call, envir=envir) >> evalInEnvir(quote(lattic...
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
...with an expression-object rather than a call-object seemed to solve the problem when this was posed as a question on StackOverflow, but Dayne was not happy with that solution for other reasons that he is not describing. -- David. > 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)), evalq...
2009 Nov 12
1
S4 objects in the data directory
...king data for non-ASCII characters ... NOTE Error: "foo" is not a defined class Call sequence: 8: stop(gettextf("\"%s\" is not a defined class", Class), domain = NA) 7: getClass(Class, where = topenv(parent.frame())) 6: new("foo", x = rep(2, 7)) 5: eval(expr, envir, enclos) 4: eval(i, envir) 3: sys.source(zfile, chdir = TRUE, envir = envir) 2: switch(ext, R = , r = { library("utils") sys.source(zfile, chdir = TRUE, envir = envir) }, RData = , rdata = , rda = load(zfile, envir = envir), TXT = , txt = , tab = , tab.gz = , tab.bz2 = , tab.xz = , txt.gz...
2002 Nov 20
2
restart
...hat offers stand-alone code windows, line numbered conditional breakpoints, statement-skipping, and graceful error trapping). I use the following function to trap errors, both in code undergoing debugging, and in the user's interactions with the debugger: eval.catching.errors <- function(i, envir) do.in.envir( envir=find.debug.HQ( FALSE), { if(.evaluated.OK.) { .evaluated.OK. <<- FALSE restart(TRUE) j <- eval( i, envir=envir) .evaluated.OK. <<- TRUE return(j) } else return(NULL) }) The function is a bit opaque because I have fiddled with the lexical scopi...
2005 May 14
2
help with eval
I've been looking at the help page for eval for a while, but I can't make sense of why this example does not work. show.a <- function() { a } init.env <- function() { a <- 200 environment() } my.env <- init.env() ls(envir=my.env) # returns this: # > ls(envir=my.env) # [1] "a" # but this does not work: eval(expression(show.a()),envir=my.env) # > eval(expression(show.a()),envir=my.env) # Error in show.a() : Object "a" not found # > The hel...
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:...
2013 Jun 25
1
Perplexed with environment
Hi I migrated from Linux to Mac, but I don't this has anything to do with it, but I am not sure. I am writing a small logger package, in which I have a file aaa.R: ,---- | .logData <- new.env() | assign("loggingThreshold", 10, envir = .logData) | assign("logToFile", FALSE, envir = .logData) | assign("logFileName", NULL, envir = .logData) | | assign("logToConsole", TRUE, envir = .logData) | ## | assign("logHeaderLevel", 0, envir = .logData) | assign("logHeader", &qu...
2012 Nov 07
4
save/load and package namespaces
Could someone explain to me what namespaces are loaded/saved when objects are saved? Specifically, I'm using this: save(list = ls(all.names = TRUE, envir = envir), file = name, envir = envir) to save out everything from an environment. Later, loading it on another machine, I'm surprised to see the load failing for being unable to load certain packages. Could anyone help me understand why this happens? Jamie Olson [[alternative HTML version...
2007 Nov 13
1
`eval' and environment question
my understanding of `eval' behaviour is obviously incomplete. my question: usually `eval(expr)' and `eval(expr, envir=parent.frame())' should be identical. why does the last `eval' (yielding `r3') in this code _not_ evaluate in the local environment of function `f' but rather in the global environment (if `f' is called from there)? #--------------------------------------------------...
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,...
2006 Feb 01
1
recover() (PR#8546)
...at: Browse[1]> recover() Enter a frame number, or 0 to exit 1: window(test, start = c(15, 1), end = c(17, 1), extend = TRUE) 2: window.ts(test, start = c(15, 1), end = c(17, 1), extend = TRUE) 3: as.ts(window.default(x, ...)) 4: window.default(x, ...) 5: function () 6: eval(quote(browser()), envir = sys.frame(which)) 7: eval(expr, envir, enclos) Selection: recover() Enter an item from the menu, or 0 to exit Selection: 0 Browse[1]> recover() Enter a frame number, or 0 to exit 1: window(test, start = c(15, 1), end = c(17, 1), extend = TRUE) 2: window.ts(test, start = c(15, 1), end = c(17...