Displaying 18 results from an estimated 18 matches for "r_baseenv".
Did you mean:
baseenv
2007 Jun 24
1
There was a problem by the use of snow.
....000000000 +0900
+++ R-2.5.0/src/modules/internet/sockconn.c 2007-06-25
00:51:38.000000000 +0900
@@ -155,14 +155,19 @@
static size_t sock_read(void *ptr, size_t size, size_t nitems,
Rconnection con)
{
+ int timeout = asInteger(GetOption(install("timeout"), R_BaseEnv));
+
+ R_SockTimeout(timeout);
return sock_read_helper(con, ptr, size * nitems)/size;
}
static size_t sock_write(const void *ptr, size_t size, size_t nitems,
Rconnection con)
{
+ int timeout = asInteger(GetOption(install("timeout"), R_BaseEnv));...
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
...(!mhnd_sentinel) {
+ SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue));
+ R_PreserveObject(sentinel);
+ UNPROTECT(1);
+ // Avoid leaking the sentinel before setting the finalizer
+ RCNTXT cntxt;
+ begincontext(&cntxt, CTXT_CCODE, R_NilValue, R_BaseEnv, R_BaseEnv,
+ R_NilValue, R_NilValue);
+ cntxt.cend = &rollback_mhnd_sentinel;
+ cntxt.cenddata = sentinel;
+ R_RegisterCFinalizerEx(sentinel, cleanup_mhnd, TRUE);
+ // Succeeded, no need to clean up if endcontext() fails allocation
+ mhnd_sentinel = s...
2009 Jun 16
1
calling handlers within R_tryEval
...tryEval (from JRI in my case), is there a way to setup
error recovery strategy and more generally calling handlers.
From my reading of context.c, R_tryEval calls R_ToplevelExec which
creates a context like this:
begincontext(&thiscontext, CTXT_TOPLEVEL, R_NilValue, R_GlobalEnv,
R_BaseEnv, R_NilValue, R_NilValue);
so I guess what I am trying to do is add "cend" and/or "handlerstack" to
this context. Is this possible ? Are there examples of packages doing this ?
Romain
--
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog...
2024 Apr 25
1
Big speedup in install.packages() by re-using connections
I'd like to raise this again now that 4.4 is out.
Below is a more complete patch which includes a function to properly
cleanup libcurl when R quits. Implementing this is a little tricky
because libcurl is a separate "module" in R, perhaps there is a better
way, but this works:
view: https://github.com/r-devel/r-svn/pull/166/files
patch:
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.
2024 Sep 02
1
Big speedup in install.packages() by re-using connections
...SEXP sentinel = PROTECT(R_MakeExternalPtr(NULL, R_NilValue, R_NilValue));
> + R_PreserveObject(sentinel);
> + UNPROTECT(1);
> + // Avoid leaking the sentinel before setting the finalizer
> + RCNTXT cntxt;
> + begincontext(&cntxt, CTXT_CCODE, R_NilValue, R_BaseEnv, R_BaseEnv,
> + R_NilValue, R_NilValue);
> + cntxt.cend = &rollback_mhnd_sentinel;
> + cntxt.cenddata = sentinel;
> + R_RegisterCFinalizerEx(sentinel, cleanup_mhnd, TRUE);
> + // Succeeded, no need to clean up if endcontext() fails allocation...
2007 Apr 07
2
Rf_PrintValue problem with methods::show
Hi,
I think this is a bug (even though I can't find documentation
explicitly saying that it should work). Basically, Rf_PrintValue(obj)
fails when 'obj' is an S4 object that should be printed using show()
rather than print(). From the error message I'm guessing that the need
to use show is detected correctly but then show is not found.
"cbind2" in the code below is just
2009 Mar 03
1
profiler and loops
...P ? CHAR(PRINTNAME(fun)) :
"<Anonymous>");
}
}
so we can see it only cares about context CTXT_FUNCTION and
CTXT_BUILTIN, when for loops play with CTXT_LOOP (this is again in
eval.c within the do_for function)
begincontext(&cntxt, CTXT_LOOP, R_NilValue, rho, R_BaseEnv, R_NilValue,
R_NilValue);
which as the name implies, begins the context of the for loop. The
begincontext function looks like this :
void begincontext(RCNTXT * cptr, int flags,
SEXP syscall, SEXP env, SEXP sysp,
SEXP promargs, SEXP callfun)
{
cptr->nextcontext =...
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:
bug/suggestion: debugger should respect option "deparse.max.lines" when printing the call (PR#13647)
2009 Apr 09
0
bug/suggestion: debugger should respect option "deparse.max.lines" when printing the call (PR#13647)
...l parameters */
/* actuals = values to be bound to formals */
***************
*** 609,615 ****
--- 610,621 ----
SET_DEBUG(newrho, DEBUG(op));
if (DEBUG(op)) {
Rprintf("debugging in: ");
+
+ itmp = asInteger(GetOption(install("deparse.max.lines"), R_BaseEnv));
+ if(itmp != NA_INTEGER && tmp > 0) R_BrowseLines = itmp;
PrintValueRec(call,rho);
+ R_BrowseLines = 0;
+
/* Is the body a bare symbol (PR#6804) */
if (!isSymbol(body) & !isVectorAtomic(body)){
/* Find out if the body is functio...
2013 May 08
2
call R function from C code
Hi,
I am writing C code for R, but in middle of the routine I want to call
solve(A,b) function. What is the right way to solve linear set inside C
code? Is it ok to just invoke La_solve()?
2001 Aug 27
1
is.environment, as.environment, and NULL
The r-devel (1.4) code has C implementations now of the class and
class<- functions in package methods, and also of as.environment.
The last brings up a question (it shows up in the isas-tests test
suite).
as.environment(NULL) is NULL. Seems like it has to be, since NULL is
the environment associated with package:base.
But is.environment(NULL) is FALSE, which is also fairly natural, if we
2012 Nov 15
1
bug with mapply() on an S4 object
Hi,
Starting with ordinary vectors, so we know what to expect:
> mapply(function(x, y) {x * y}, 101:106, rep(1:3, 2))
[1] 101 204 309 104 210 318
> mapply(function(x, y) {x * y}, 101:106, 1:3)
[1] 101 204 309 104 210 318
Now with an S4 object:
setClass("A", representation(aa="integer"))
a <- new("A", aa=101:106)
> length(a)
2023 Feb 19
2
R: determine if `suppressMessages()` has been invoked
Awesome, this gets the job done.
To answer your question:
When using C or C++ via Rinside or within a package, those functions do not listen to suppressMessages, e.g. `Rprintf` keeps printing to the console. Since it's common to use wrapper functions in R anyway, they can run `are_messages_suppressed` and pass the information on to an explicit `verbose` argument of the C / C++ function.
2012 Mar 13
0
111 FIXMEs in main/src
...This assumes that wchar_t is UCS-2/4,
engine.c- since that is what GEMetricInfo expects */
--
engine.c:/* FIXME: should we warn on more than one character here? */
engine.c-int GEstring_to_pch(SEXP pch)
--
envir.c: FIXME ? should this also unbind the symbol value slot when rho
is
envir.c- R_BaseEnv.
--
envir.c: /* FIXME: This does not behave as described */
envir.c- R_ObjectTable *table;
--
envir.c: /* FIXME: should we install them all?) */
envir.c-
--
envir.c: /* FIXME: duplicate the hash table and assign here */
envir.c- } else {
--
envir.c: /* FIXME: A little inefficient */
envir.c...
2005 Sep 18
0
Updated rawConnection() patch
...tring(sopen) || length(sopen) != 1)
- error(_("invalid '%s' argument"), "open");
+ error(_("invalid '%s' argument"), "open");
open = CHAR(STRING_ELT(sopen, 0));
venv = CADDDR(args);
if (!isEnvironment(venv) && venv != R_BaseEnv)
error(_("invalid '%s' argument"), "environment");
ncon = NextConnection();
- if(!strlen(open) || strncmp(open, "r", 1) == 0)
+ if(!strlen(open) || (open[0] == 'r')) {
+ int isText = (!strlen(open) || (open[1] != 'b'));
+ if (TYPE...
2005 Oct 06
0
R-2.2.0 is released
...nt. To use this, configure using
--with-valgrind-instrumentation=level
where level is 1 or 2. Both levels will find more bugs with
gctorture(TRUE). Level 2 makes Valgrind run extremely slowly.
o Some support for raw vectors has been added to Rdefines.h.
o R_BaseEnv has been added, to refer to the base environment.
This is currently equal to R_NilValue, but it will change in
a future release.
BUG FIXES
o %/% has been adjusted to make x == (x %% y) + y * ( x %/% y )
more likely in cases when extended-precision registers were
interfering....
2005 Oct 06
0
R-2.2.0 is released
...nt. To use this, configure using
--with-valgrind-instrumentation=level
where level is 1 or 2. Both levels will find more bugs with
gctorture(TRUE). Level 2 makes Valgrind run extremely slowly.
o Some support for raw vectors has been added to Rdefines.h.
o R_BaseEnv has been added, to refer to the base environment.
This is currently equal to R_NilValue, but it will change in
a future release.
BUG FIXES
o %/% has been adjusted to make x == (x %% y) + y * ( x %/% y )
more likely in cases when extended-precision registers were
interfering....