Displaying 9 results from an estimated 9 matches for "prenv".
Did you mean:
renv
2018 Jan 03
3
Coping with non-standard evaluation in R program analysis
Hello R experts,
I plan to develop a tool for dynamic analysis of R programs. I would like to trace function calls at runtime, capturing argument and return values. Following a suggestion made some time ago on this list, my high-level implementation strategy is to rewrite the AST, augmenting call expressions with pre-call and post-call shims to capture the arguments and return value,
2014 Feb 11
1
getting environment from "top" promise
...ubset", "B", function(x, ...) {
ans <- callNextMethod()
ans@nrow <- nrow(ans@df)
ans
})
b <- new("B", df=mtcars)
dropLowMpg(b)
Error in eval(expr, envir, enclos) (from #3) : object 'cutoff' not found
We can fix this with a simple C function:
SEXP top_prenv(SEXP nm, SEXP env)
{
SEXP promise = findVar(nm, env);
while(TYPEOF(promise) == PROMSXP) {
env = PRENV(promise);
promise = PREXPR(promise);
}
return env;
}
With R wrapper:
top_prenv <- function(x) {
.Call2("top_prenv", substitute(x), parent.frame())
}
Then this works...
2019 Jul 12
2
strange increase in the reference number
Hi Jiefei and Duncan,
I suspect what is likely happening is that one of ENSURE_NAMEDMAX or
MARK_NOT_MUTABLE are being hit for x. These used to set named to 3, but now
set it to 7 (ie the previous and current NAMEDMAX value, respectively).
Because these are macros rather than C functions, its not easy to figure
out why one of them is being invoked from do_isvector (a cursory
exploration
2018 Jan 04
0
Coping with non-standard evaluation in R program analysis
...Science,
Northeastern University
> On Jan 3, 2018, at 7:18 PM, Peter Meilstrup <peter.meilstrup at gmail.com> wrote:
>
> For 2), it is not exposed in R's standard library but it is exposed in
> the Rinternals API. A promise that is forced in normal evaluation will
> have PRENV set to NULL.
>
> Peter
>
> On Tue, Jan 2, 2018 at 4:19 PM, Evan James Patterson
> <epatters at stanford.edu> wrote:
>> Hello R experts,
>>
>>
>> I plan to develop a tool for dynamic analysis of R programs. I would like to trace function calls at runt...
2002 Jan 02
1
Building R-1.4 on Tru64
...f_getAttrib
Rf_length
STRING_ELT
R_CHAR
R_do_slot
Rf_asChar
PRINTNAME
Rf_isNull
CAR
CDR
R_data_class
Rf_isFunction
Rf_findFun
SETCAR
Rf_eval
INTEGER
CLOENV
Rf_findVarInFrame
Rf_isSymbol
ENCLOS
SYMVALUE
Rf_asLogical
R_MissingArg
Rf_isPrimitive
do_set_prim_method
BODY
R_deferred_default_method
PREXPR
PRENV
R_DotsSymbol
DDVAL
R_set_prim_method
Rf_defineVar
R_do_slot_assign
mkdir ../../../../library/methods/libs
make[5]: Leaving directory
`/tmp_mnt/net/fire/s/fire/1/richardb/Tru64/src/library/methods/src'
make[4]: Leaving directory
`/tmp_mnt/net/fire/s/fire/1/richardb/Tru64/src/library/methods/src&...
2019 Jul 13
0
strange increase in the reference number
Re ENSURE_NAMEDMAX, I am unsure but think this happens in (src/eval.c at 492):
static SEXP forcePromise(SEXP e)
{
??? if (PRVALUE(e) == R_UnboundValue) {
??? /* ... SNIP ...*/
??? val = eval(PRCODE(e), PRENV(e));
??? /* ... SNIP ...*/
??? SET_PRSEEN(e, 0);
?? ?SET_PRVALUE(e, val);
?? ?ENSURE_NAMEDMAX(val);???????????????? <<<<<<< HERE
?? ?SET_PRENV(e, R_NilValue);
??? }
??? return PRVALUE(e);
}
as part of the evaluations of the closure.? `forcePromise` is called ineval (src/eval.c...
2006 May 19
2
delayedAssign and interrupts
I noticed something recently that I thought was odd:
delayedAssign("x", { Sys.sleep(5); 1 })
x ## Hit Ctrl-C within the first second or 2
gives me:
> delayedAssign("x", { Sys.sleep(5); 1 })
> x ## Hit Ctrl-C within the first second or two
> x
Error: recursive default argument reference
>
My only problem here is that now I'm stuck---there's no way
2007 Jun 12
1
bug in R environments? Was: [BioC] 'recursive default argument' error...
Dear developers,
has anyone experienced the problem described below? Is it a bug in
handling interrupts in R?
Best,
Oleg
-------- Original Message --------
Subject: Re: [BioC] 'recursive default argument' error in GOENTREZID2GO
From: Diego Diez <diez at kuicr.kyoto-u.ac.jp>
...steps that use to reach me to that point. It happens with any
environment, or at least annotation
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.