Displaying 3 results from an estimated 3 matches for "r_basenamespac".
Did you mean:
r_basenamespace
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
...===============================
--- src/main/builtin.c (revision 66783)
+++ src/main/builtin.c (working copy)
@@ -356,6 +356,24 @@
return( ENCLOS(arg) );
}
+static Rboolean R_IsImportsEnv(SEXP env)
+{
+ if (isNull(env) || !isEnvironment(env))
+ return FALSE;
+ if (ENCLOS(env) != R_BaseNamespace)
+ return FALSE;
+ SEXP name = getAttrib(env, R_NameSymbol);
+ if (!isString(name) || length(name) != 1)
+ return FALSE;
+
+ const char *imports_prefix = "imports:";
+ const char *name_string = CHAR(STRING_ELT(name, 0));
+ if (!strncmp(name_string, imports_pr...
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:
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.