Displaying 11 results from an estimated 11 matches for "r_emptyenv".
Did you mean:
emptyenv
2010 Dec 17
2
newbie question on str output
...1 1 1 1 1 1 1 1
...
$ conc : num 95 175 250 350 500 675 1000 95 175 250 ...
$ uptake : num 16 30.4 34.8 37.2 35.3 39.2 39.7 13.6 27.3 37.1 ...
- attr(*, "formula")=Class 'formula' length 3 uptake ~ conc | Plant
.. ..- attr(*, ".Environment")=<environment: R_EmptyEnv>
- attr(*, "outer")=Class 'formula' length 2 ~Treatment * Type
.. ..- attr(*, ".Environment")=<environment: R_EmptyEnv>
- attr(*, "labels")=List of 2
..$ x: chr "Ambient carbon dioxide concentration"
..$ y: chr "CO2 uptake rate&q...
2016 Aug 05
2
Extra copies of objects in environments when using $ operator?
My understanding is that R will not make copies of lists if there is
only one reference to the object. However, I've encountered a case
where R does make copies, even though (I think) there should be only
one reference to the object. I hope that someone could shed some light
on why this is happening.
I'll start with a simple example. Below, x is a list with one element,
and changing that
2011 Jan 11
1
as.environment.list provides inconsistent results under torture
...ract?res incorrecte
Is it because the call made by lang4 is not protected while evaluated in
this line :
case VECSXP: {
/* implement as.environment.list() {isObject(.) is false for a list} */
return(eval(lang4(install("list2env"), arg,
/*envir = */R_NilValue, /* parent = */R_EmptyEnv),
rho));
}
(BTW, this was detected in a looooooooong Rcpp-devel thread. See
http://comments.gmane.org/gmane.comp.lang.r.rcpp/1336)
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/fT2rZM : highlight 0.2-5
|...
2016 Aug 05
0
Extra copies of objects in environments when using $ operator?
...e$x marks values as immutable if they have any references by
setting NAMED to 2. You can see this with
> e <- new.env(parent = emptyenv())
> e$x <- list(1)
> .Internal(inspect(e))
@30b2498 04 ENVSXP g0c0 [NAM(1)] <0x30b2498>
ENCLOS:
@2600e98 04 ENVSXP g0c0 [MARK,NAM(2)] <R_EmptyEnv>
HASHTAB:
@2e41540 19 VECSXP g0c7 [] (len=29, tl=1)
@25c9628 00 NILSXP g0c0 [MARK,NAM(2)]
@25c9628 00 NILSXP g0c0 [MARK,NAM(2)]
@25c9628 00 NILSXP g0c0 [MARK,NAM(2)]
@25c9628 00 NILSXP g0c0 [MARK,NAM(2)]
@30b3370 02 LISTSXP g0c0 []
TAG: @2637870 01 SYMSXP g0c0...
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
2015 Jan 14
0
Is the tcltk failure in affylmGUI related to R bug 15957
Seems unlikely that that particular bug is involved. I seem to recall some change related to inadvertent variable capture in .TkRoot$env (?). At any rate, we currently have
> parent.env(.TkRoot$env)
<environment: R_EmptyEnv>
which used to be
> parent.env(.TkRoot$env)
<environment: R_GlobalEnv>
as a result, this won't work any more because R_EmptyEnv has no operators and functions in it:
> evalq(x <- 1, .TkRoot$env)
Error in eval(substitute(expr), envir, enclos) :
could not find function &q...
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
...mports_prefix, strlen(imports_prefix)))
+ return TRUE;
+ else
+ return FALSE;
+}
+
SEXP attribute_hidden do_parentenvgets(SEXP call, SEXP op, SEXP args, SEXP rho)
{
SEXP env, parent;
@@ -371,6 +389,10 @@
error(_("argument is not an environment"));
if( env == R_EmptyEnv )
error(_("can not set parent of the empty environment"));
+ if (R_EnvironmentIsLocked(env) && R_IsNamespaceEnv(env))
+ error(_("can not set the parent environment of a namespace"));
+ if (R_EnvironmentIsLocked(env) && R_IsImportsEnv(env))
+ err...
2015 Jan 18
1
Is the tcltk failure in affylmGUI related to R bug 15957
...d.
----- peter dalgaard <pdalgd at gmail.com> wrote:
> Seems unlikely that that particular bug is involved. I seem to recall some change related to inadvertent variable capture in .TkRoot$env (?). At any rate, we currently have
>
> > parent.env(.TkRoot$env)
> <environment: R_EmptyEnv>
>
> which used to be
>
> > parent.env(.TkRoot$env)
> <environment: R_GlobalEnv>
>
> as a result, this won't work any more because R_EmptyEnv has no operators and functions in it:
>
> > evalq(x <- 1, .TkRoot$env)
> Error in eval(substitute(exp...
2023 Nov 15
1
saveRDS()/readRDS() on environments
Dear r-devel,
I was surprised to see that saveRDS() and readRDS() work quite well with
environments, see below:
```
z <- 3 # in global env
y <- new.env()
y$a <- 1
x <- new.env(parent = y)
x$b <- 2
saveRDS(x, "x.RDS")
# in a new session
x <- readRDS("x.RDS")
y <- parent.env(x)
x$b
#> [1] 2
y$a
#> [1] 1
parent.env(y)
#> <environment:
2011 Jan 11
0
[Rcpp-devel] Loading a package using Rcpp Modules results in memory corruption
...the problem, at least under
Linux:
case VECSXP: {
Rprintf("VECSXP as.environment\n");
/* implement as.environment.list() {isObject(.) is false for a list} */
SEXP sp = PROTECT(lang4(install("list2env"), arg,
/*envir = */R_NilValue, /* parent = */R_EmptyEnv));
SEXP res = eval(sp, rho);
UNPROTECT(1);
return res;
}
Dominick
> Romain
>
>
> --
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
> http://romainfrancois.blog.free.fr
> |- http://bit.ly/fT2rZM : highlight 0.2-5
> |- http://bit....
2009 Dec 16
2
What is the fastest way to see what are in an RData file?
Currently, I load the RData file then ls() and str(). But loading the file
takes too long if the file is big. Most of the time, I only interested what
the variables are in the the file and the attributes of the variables (like
if it is a data.frame, matrix, what are the colnames/rownames, etc.)
I'm wondering if there is any facility in R to help me avoid loading the
whole file.