Displaying 3 results from an estimated 3 matches for "my_mvb_parent".
2016 Dec 12
0
[RE: why does parent.frame() cycle when called from inside capture.output()?]
...39;t just use `mvb.parent.frame` as a replacement for
# `parent.frame`, because the former throws an error when there is no
# parent frame - while we had relied on the latter gracefully giving
# us the global environment. So here's a wrapper which gives
# mvb.parent.frame the behavior we want:
my_mvb_parent=function() {
tryCatch(
mvb.parent.frame(2),
error=function(e) { globalenv()})
}
desubN <- function(y,n=1) {
env=environment();
for(i in 1:n) {
y = do.call(substitute, list(substitute(y)), env=env)
env = do.call(my_mvb_parent, list(), env=env)
}
deparse(y)
}
g2=function...
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help,
I ran into this strange behavior:
# showstack is supposed to walk through the stack of parent
# environments when it is called:
showstack = function() {
env = environment()
for(i in 1:12) {
env = do.call(parent.frame, list(), env=env)
print(env)
}
}
# a simple chain of functions:
g3=function(t) showstack()
2016 Dec 12
2
why does parent.frame() cycle when called from inside capture.output()?
Hello R devel/help,
I ran into this strange behavior:
# showstack is supposed to walk through the stack of parent
# environments when it is called:
showstack = function() {
env = environment()
for(i in 1:12) {
env = do.call(parent.frame, list(), env=env)
print(env)
}
}
# a simple chain of functions:
g3=function(t) showstack()