Displaying 6 results from an estimated 6 matches for "r_sysfunct".
2016 Mar 27
2
sys.function(0)
As I understand
https://stat.ethz.ch/R-manual/R-devel/library/base/html/sys.parent.html
sys.function(n) returns the function associated with stack frame n.
Since frame 0 is defined as .GlobalEnv which is not associated with a
function, I would expect this to always return NULL. However, it does not:
> sys.function()
NULL
> f <- function(x) sys.function(x)
> f(0)
function(x)
2016 Mar 27
0
sys.function(0)
...he global envir. It is pretty clear from the underlying C code that the three functions treat their argument differently:
R_sysframe has
if (n == 0)
return(R_GlobalEnv);
if (n > 0)
n = framedepth(cptr) - n;
else
n = -n;
whereas the other two (R_syscall and R_sysfunction) omit the special treatment for n==0. Without this, n==0, comes out unchanged from the if-construct, indicating that one should go 0 frames up the stack (same as n==framedepth(cptr)).
Obviously, it won't work to document the "which" argument identically for all three functions......
2016 Mar 27
1
sys.function(0)
...that the three functions treat their argument differently:
>
> R_sysframe has
>
> if (n == 0)
> return(R_GlobalEnv);
>
> if (n > 0)
> n = framedepth(cptr) - n;
> else
> n = -n;
>
> whereas the other two (R_syscall and R_sysfunction) omit the special treatment for n==0. Without this, n==0, comes out unchanged from the if-construct, indicating that one should go 0 frames up the stack (same as n==framedepth(cptr)).
>
> Obviously, it won't work to document the "which" argument identically for all three func...
2001 Apr 25
0
match.arg confusion (PR#921)
...has to grab the call, take the 1st element,
and reevaluate it in the parent frame. It is quite easy to think up
examples where a second evaluation does not give the same value as
the first.
Your particular case is of a slightly different natur and should be
easily fixable by replacing findVar in R_sysfunction by findVar1 and
looking specifically for objects of mode "function", but the basic
problem persists. I don't think I want to risk fixing this (and maybe
unfixing something else) for 1.2.3 tomorrow though.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ ---...
2002 Apr 09
0
match.arg confusion (PR#921)
...D> it in the parent frame. It is quite easy to think up
PD> examples where a second evaluation does not give the
PD> same value as the first.
PD> Your particular case is of a slightly different natur
PD> and should be easily fixable by replacing findVar in
PD> R_sysfunction by findVar1 and looking specifically for
PD> objects of mode "function", but the basic problem
PD> persists. I don't think I want to risk fixing this (and
PD> maybe unfixing something else) for 1.2.3 tomorrow
PD> though.
and Peter *did* implement the ``...
2004 Jun 28
2
Problem with hasArg and the ... argument (PR#7027)
Full_Name: Jelle Goeman
Version: 1.9.0
OS: mingw32, windows 2000
Submission from: (NULL) (145.88.209.33)
Hi Everyone,
I get very strange results using the function hasArg with the ... function
argument. In my own function:
> gt <- globaltest(X,Y)
> sampling(gt)
works fine, but
> sampling(globaltest(X,Y))
results in:
Error in eval(expr, envir, enclos) : "missing"