search for: environments

Displaying 20 results from an estimated 36854 matches for "environments".

Did you mean: environment
2002 Oct 13
1
The class attribute on an environment seems buggy (PR#2159)
Full_Name: Henrik Bengtsson Version: 1.6.0, 1.5.1 OS: WinXP Pro Submission from: (NULL) (128.250.252.82) The following example, which I tested on both R v1.5.1 and R v1.6.0 on WinXP Pro, shows the problem I encountered when trying to use the class attribute of an environment: # Define method print() for class Environment C print(e) # gives: # [1] "An Environment!" # Exit [R]
2005 Sep 27
3
Dummy quesion about environment
Hi, I'm trying to understand environment object in R. I used the example: f <- function(x) { y <- 10 g <- function(x) x + y return(g) } h <- f() h(3) then i saw that f return an environment > h function(x) x + y <environment: 01B28570> but I coudn't access to x and y object in that environment: I tried
2004 Jun 14
5
terminology for frames and environments
...and the parent of the parent, etc. (as opposed to looking in the calling frame next and the caller of the caller, etc.) Now I thought that standard terminology in R was: 1. enclosing environment or parent environment if one wanted to refer to the parent relative to the parent/child hierarchy of environments or 2. calling frame or parent frame if one wanted to refer to a parent relative to the environments corresponding to the functions in the stack of currently outstanding function calls but here we seem to be referring to a parent frame as a #1. Could someone please clarify what standard termin...
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help, I ran into this strange behavior: # showstack is supposed to walk through the stack of parent # environments when it is called: showstack = function() { env = environment() for(i in 1:12) { env = do.call(parent.frame, list(), env=env) print(env) } } # a simple chain of functions: g3=function(t) showstack() g2=function(w) g3(w) g1=function(z) g2(z)...
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help, I ran into this strange behavior: # showstack is supposed to walk through the stack of parent # environments when it is called: showstack = function() { env = environment() for(i in 1:12) { env = do.call(parent.frame, list(), env=env) print(env) } } # a simple chain of functions: g3=function(t) showstack() g2=function(w) g3(w) g1=function(z) g2(z)...
2014 May 17
1
environment question
According to :https://stat.ethz.ch/R-manual/R-devel/library/base/html/environment.html "If |fun| is a function or a formula then |environment(fun)| returns the environment associated with that function or formula. If |fun| is |NULL| then the current evaluation environment is returned." > environment() <environment: R_GlobalEnv> > environment(environment)
2008 Mar 07
3
merging environments
...of various R-core folks who feel that mle() doesn't need a "data" argument, and that users would be better off learning to deal with function closures, I am *still* trying to make such things work in a reasonably smooth fashion ... Is there a standard idiom for "merging" environments? i.e., suppose a function has an environment that I want to preserve, but _add_ the contents of a data list -- would something like this do it? Is there a less ugly way? x <- 0 y <- 1 z <- 2 f <- function() { x+y+z } f2 <- function(fun,data) { L <- ls(pos=environment(...
2010 Dec 14
7
Environment specified by external nodes ignored
My custom external nodes script sets the environment variable, but Puppet ignores it. For testing, I have a manifest that deploys this template to a file: environment = <%= environment %> The output from my external nodes script: --- classes: - devhost environment: development parameters: memcached_memory: ''32'' But running "puppetd --test" results in the
2015 Oct 09
4
A where() functions that does what exists() does but return the environment when object lives?
Hi, exists("foo", inherits=TRUE) check whether an object named "foo" exists, and get("foo", inherits=TRUE) retrieves it. I'm looking for a similar function to exists() that returns the environment where the object "foo" exists, iff at all. If not found, NULL is returned. Does that exist? EXAMPLE #1: > sample2 <- base::sample > env <-
2013 Aug 19
3
Puppet environments vs App environments
I''ve setup dynamic environments using git but I''m confused about how environments are actually supposed to be used. We''re a small ISP and have freeradius servers, VPN servers and web servers. I''ve been using environments to enable me as the sysadmin to build and test new manifests/modules before dep...
2007 Sep 18
1
Re-attaching a package environment drops the attributes
Hi. contrary to other environments, the attributes of a *package* environment are dropped (from the new environment) when attach():ing it to the search() path. This might or might not be surprising, but have some side effects if rearranging/attaching package environments. # Example - Regular environments env <- new.env() attr(e...
2005 Nov 24
2
what's the meaning of these in R-lang?
In this case the environment contains the variables local to the function, and its enclosure is the environment of the enclosing function.(R-lang:p11) I want to know if the "enclosing function" means the closure of the function? for example ,if I call function mean(),and the create an environment,say e1,then the enclosure of e1 is the namespace of base package? Right? Thank you!
2010 Apr 27
2
when setting environment: target of assignment expands to non-language object
Hi, I am trying to place my own functions in the nlme environment: The following statement works: environment(coef.corSPT) <- environment(getS3method("coef","corSpatial")) but this one returns an error: environment(get("coef<-.corSPT")) <- environment(getS3method("coef<-","corSpatial")) Error in
2012 Nov 25
0
Problema de compilacion con Rcpp
Hola, necesito compilar un programa de tipo source (Rstan) con c++ La propia web del programa indica como hacerlo con Rcpp. Sin embargo no consigo que funcione Rcpp ni con un ejemplo básico. He seguido las instrucciones que vienen en http://tonybreyal.wordpress.com/2011/12/07/installing-rcpp-on-windows-7-for-r-and-c-integration/ Tengo instalado Rtools y los paths correspondientes, pero no
2016 Dec 05
2
imapsieve environment variables missing?
On 2016-12-05 07:22, Stephan Bosch wrote: > Op 5-12-2016 om 16:10 schreef MRob: >> On 2016-12-05 06:13, Stephan Bosch wrote: >>> Op 5-12-2016 om 14:32 schreef MRob: >>> >>> Could you show me your full script? I am mainly interested in the >>> require statements involved. >> >> I don't know how I managed to compile only using direct
2010 Dec 26
2
environment question
Hello, everybody. I'm putting together some lecture notes and course exercises on R programming. My plan is to pick some R packages, ask students to read through code and see why things work, maybe make some changes. As I look for examples, I'm running up against the problem that packages use coding idioms that are unfamiliar to me. A difficult thing for me is explaining scope of
2020 Aug 09
3
lm() takes weights from formula environment
I know this programmers can reason this out from R's late parameter evaluation rules PLUS the explicit match.call()/eval() lm() does to work with the passed in formula and data frame. But, from a statistical user point of view this seems to be counter-productive. At best it works as if the user is passing in the name of the weights variable instead of values (I know this is the obvious
2009 Dec 10
2
Assigning variables into an environment.
...quot; "beta" "foo" "gamma" "v" The parameters got assigned in the global environment (as well as in the environment of bar()? Or instead of?). I didn't want that to happen. Questions: (a) What did I do wrong? (b) What am I not understanding about environments? (c) How can I get the parameters to be assigned in the environment of bar() and ***NOT*** in the global environment? (d) Is it time to go to the pub yet? [Please don't make suggestions about doing it all some other way, e.g. using the ``...'' argument facility. I know there ar...
2015 Aug 10
2
pigeonhole/lda accessing -m folder
complete patch. some parts were missing before diff --git a/src/lib-sieve/plugins/environment/ext-environment-common.c b/src/lib-sieve/plugins/environment/ext-environment-common.c --- a/src/lib-sieve/plugins/environment/ext-environment-common.c +++ b/src/lib-sieve/plugins/environment/ext-environment-common.c @@ -24,7 +24,8 @@ static const struct sieve_environment_item *core_env_items[] = {
2006 Sep 18
1
BSD Auth: set child environment variables requested by login script [PATCH]
Hello, in the BSD Authentication system the login script can request environment variables to be set/unset. The call to auth_close() in auth-passwd.c does change the current environment, but those changes are lost for the child environment. It would be really useful to add some kind of mechanism to get those changes into the child environment. I've added two possible solutions. Both