search for: framedepth

Displaying 4 results from an estimated 4 matches for "framedepth".

Did you mean: fragdepth
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)
...For the latter, it means the current call/function, whereas sys.frame(0) is always the 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 wo...
2016 Mar 27
1
sys.function(0)
...l/function, whereas sys.frame(0) is always the 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)). > &...
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"