[Deprecated]

The eval_ and call_ families of functions provide a replacement for the base R functions prefixed with sys. (which are all about the context stack), as well as for parent.frame() (which is the only base R function for querying the call stack). The context stack includes all R-level evaluation contexts. It is linear in terms of execution history but due to lazy evaluation it is potentially nonlinear in terms of call history. The call stack history, on the other hand, is homogenous.

global_frame()

current_frame()

ctxt_frame(n = 1)

call_frame(n = 1, clean = TRUE)

ctxt_depth()

call_depth()

ctxt_stack(n = NULL, trim = 0)

call_stack(n = NULL, clean = TRUE)

Arguments

n

The number of frames to go back in the stack.

clean

Whether to post-process the call stack to clean non-standard frames. If TRUE, suboptimal call-stack entries by base::eval() will be cleaned up: the duplicate frame created by eval() is eliminated.

trim

The number of layers of intervening frames to trim off the stack. See stack_trim() and examples.

Details

ctxt_frame() and call_frame() return a frame object containing the following fields: expr and env (call expression and evaluation environment), pos and caller_pos (position of current frame in the context stack and position of the caller), and fun (function of the current frame). ctxt_stack() and call_stack() return a list of all context or call frames on the stack. Finally, ctxt_depth() and call_depth() report the current context position or the number of calling frames on the stack.

The base R functions take two sorts of arguments to indicate which frame to query: which and n. The n argument is straightforward: it's the number of frames to go down the stack, with n = 1 referring to the current context. The which argument is more complicated and changes meaning for values lower than 1. For the sake of consistency, the rlang functions all take the same kind of argument n. This argument has a single meaning (the number of frames to go down the stack) and cannot be lower than 1.

Note finally that parent.frame(1) corresponds to call_frame(2)$env, as n = 1 always refers to the current frame. This makes the _frame() and _stack() functions consistent: ctxt_frame(2) is the same as ctxt_stack()[[2]]. Also, ctxt_depth() returns one more frame than base::sys.nframe() because it counts the global frame. That is consistent with the _stack() functions which return the global frame as well. This way, call_stack(call_depth()) is the same as global_frame().

Life cycle

These functions are soft-deprecated and replaced by trace_back().

Examples

# Expressions within arguments count as contexts identity(identity(ctxt_depth())) # returns 2
#> Warning: `ctxt_depth()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [1] 27
# But they are not part of the call stack because arguments are # evaluated within the calling function (or the global environment # if called at top level) identity(identity(call_depth())) # returns 0
#> Warning: `call_depth()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [1] 14
# The context stacks includes all intervening execution frames. The # call stack doesn't: f <- function(x) identity(x) f(f(ctxt_stack()))
#> [[1]] #> <frame 28> (27) #> expr: identity(x) #> env: [local 0x5613cfb129c8] #> #> [[2]] #> <frame 27> (24) #> expr: f(ctxt_stack()) #> env: [local 0x5613cfb12878] #> #> [[3]] #> <frame 26> (25) #> expr: identity(x) #> env: [local 0x5613cfb12728] #> #> [[4]] #> <frame 25> (24) #> expr: f(f(ctxt_stack())) #> env: [local 0x5613cfb12610] #> #> [[5]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[6]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfb12450] #> #> [[7]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613cfb12220] #> #> [[8]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613cfb11c38] #> #> [[9]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613cfb112d0] #> #> [[10]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613cfb13148] #> #> [[11]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613cfb16bc0] #> #> [[12]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613cfb17228] #> #> [[13]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613cfb16fc0] #> #> [[14]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613cfb16e00] #> #> [[15]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613cfb16d20] #> #> [[16]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613cfb2ef18] #> #> [[17]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[18]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[19]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[20]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[21]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[22]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[23]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[24]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[25]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[26]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[27]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[28]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[29]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
f(f(call_stack()))
#> Warning: `call_stack()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> [[1]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[2]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613ced85df8] #> #> [[3]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[4]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[5]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[6]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[7]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[8]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[9]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[10]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[11]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[12]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[13]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[14]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "call_stack" "stack"
g <- function(cmd) cmd() f(g(ctxt_stack))
#> [[1]] #> <frame 27> (24) #> expr: g(ctxt_stack) #> env: [local 0x5613ce9b5ab8] #> #> [[2]] #> <frame 26> (25) #> expr: identity(x) #> env: [local 0x5613ce9b5930] #> #> [[3]] #> <frame 25> (24) #> expr: f(g(ctxt_stack)) #> env: [local 0x5613ce9b5770] #> #> [[4]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[5]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613ce9b9178] #> #> [[6]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613ce9b8ed8] #> #> [[7]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613ce9b88f0] #> #> [[8]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613ce9b8148] #> #> [[9]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613ce9b7d90] #> #> [[10]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613ce9b7a48] #> #> [[11]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613ce9baff0] #> #> [[12]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613ce9bad88] #> #> [[13]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613ce9ba880] #> #> [[14]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613ce9ba768] #> #> [[15]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613ce9d9c78] #> #> [[16]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[17]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[18]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[19]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[20]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[21]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[22]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[23]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[24]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[25]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[26]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[27]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[28]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
f(g(call_stack))
#> [[1]] #> <frame 27> (23) #> expr: g(call_stack) #> env: [local 0x5613d4462740] #> #> [[2]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[3]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d48db590] #> #> [[4]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[5]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[6]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[7]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[8]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[9]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[10]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[11]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[12]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[13]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[14]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[15]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "call_stack" "stack"
# The rlang _stack() functions return a list of frame # objects. Use purrr::transpose() or index a field with # purrr::map()'s to extract a particular field from a stack: # stack <- f(f(call_stack())) # purrr::map(stack, "env") # purrr::transpose(stack)$expr # current_frame() is an alias for ctxt_frame(1) fn <- function() list(current = current_frame(), first = ctxt_frame(1)) fn()
#> Warning: `current_frame()` is deprecated as of rlang 0.3.0. #> This warning is displayed once per session.
#> $current #> <frame 25> (24) #> expr: fn() #> env: [local 0x5613d2893cf0] #> #> $first #> <frame 25> (24) #> expr: fn() #> env: [local 0x5613d2893cf0] #>
# While current_frame() is the top of the stack, global_frame() is # the bottom: fn <- function() { n <- ctxt_depth() ctxt_frame(n) } identical(fn(), global_frame())
#> [1] TRUE
# ctxt_stack() returns a stack with all intervening frames. You can # trim layers of intervening frames with the trim argument: identity(identity(ctxt_stack()))
#> [[1]] #> <frame 26> (24) #> expr: identity(ctxt_stack()) #> env: [local 0x5613d45b9848] #> #> [[2]] #> <frame 25> (24) #> expr: identity(identity(ctxt_stack())) #> env: [local 0x5613d45b9960] #> #> [[3]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[4]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d45b9b20] #> #> [[5]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d45b9d50] #> #> [[6]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d45ba300] #> #> [[7]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d45ba878] #> #> [[8]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d45babc0] #> #> [[9]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d45b70d8] #> #> [[10]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d45b77a0] #> #> [[11]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d45b79d0] #> #> [[12]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d45b7b58] #> #> [[13]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d45b7c38] #> #> [[14]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d2d78a28] #> #> [[15]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[16]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[17]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[18]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[19]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[20]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[21]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[22]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[23]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[24]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[25]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[26]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[27]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
identity(identity(ctxt_stack(trim = 1)))
#> [[1]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[2]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d2e37b70] #> #> [[3]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d2e37da0] #> #> [[4]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d2e38350] #> #> [[5]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d2e388c8] #> #> [[6]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d2e34de0] #> #> [[7]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d2e35128] #> #> [[8]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d2e357f0] #> #> [[9]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d2e35a20] #> #> [[10]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d2e35ba8] #> #> [[11]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d2e35c88] #> #> [[12]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d39e2170] #> #> [[13]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[14]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[15]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[16]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[17]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[18]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[19]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[20]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[21]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[22]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[23]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[24]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[25]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# ctxt_stack() is called within fn() with intervening frames: fn <- function(trim) identity(identity(ctxt_stack(trim = trim))) fn(0)
#> [[1]] #> <frame 27> (25) #> expr: identity(ctxt_stack(trim = trim)) #> env: [local 0x5613d3b98b28] #> #> [[2]] #> <frame 26> (25) #> expr: identity(identity(ctxt_stack(trim = trim))) #> env: [local 0x5613d3b98c40] #> #> [[3]] #> <frame 25> (24) #> expr: fn(0) #> env: [local 0x5613d3b98d58] #> #> [[4]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[5]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d3b98f18] #> #> [[6]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d3b99148] #> #> [[7]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d3b996f8] #> #> [[8]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d3b99c70] #> #> [[9]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d3b99fb8] #> #> [[10]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d3b9a300] #> #> [[11]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d3b96b98] #> #> [[12]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d3b96dc8] #> #> [[13]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d3b96f50] #> #> [[14]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d3b97030] #> #> [[15]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d346d6d0] #> #> [[16]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[17]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[18]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[19]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[20]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[21]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[22]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[23]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[24]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[25]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[26]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[27]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[28]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# We can trim the first layer of those: fn(1)
#> [[1]] #> <frame 25> (24) #> expr: fn(1) #> env: [local 0x5613d2ebe0f8] #> #> [[2]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[3]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d2ebe2b8] #> #> [[4]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d2ebe4e8] #> #> [[5]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d2ebea98] #> #> [[6]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d2ebf010] #> #> [[7]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d2ebf358] #> #> [[8]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d2ebf6a0] #> #> [[9]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d2ebbf38] #> #> [[10]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d2ebc168] #> #> [[11]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d2ebc2f0] #> #> [[12]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d2ebc3d0] #> #> [[13]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d3f0cb88] #> #> [[14]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[15]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[16]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[17]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[18]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[19]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[20]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[21]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[22]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[23]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[24]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[25]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[26]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
# The outside intervening frames (at the fn() call site) are still # returned, but can be trimmed as well: identity(identity(fn(1)))
#> [[1]] #> <frame 27> (24) #> expr: fn(1) #> env: [local 0x5613d4053da0] #> #> [[2]] #> <frame 26> (24) #> expr: identity(fn(1)) #> env: [local 0x5613d4053eb8] #> #> [[3]] #> <frame 25> (24) #> expr: identity(identity(fn(1))) #> env: [local 0x5613d4053fd0] #> #> [[4]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[5]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d4050360] #> #> [[6]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d4050590] #> #> [[7]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d4050b40] #> #> [[8]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d40510b8] #> #> [[9]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d4051400] #> #> [[10]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d4051748] #> #> [[11]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d4051e10] #> #> [[12]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d4052040] #> #> [[13]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d404e398] #> #> [[14]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d404e478] #> #> [[15]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d40d89e0] #> #> [[16]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[17]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[18]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[19]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[20]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[21]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[22]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[23]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[24]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[25]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[26]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[27]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[28]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
#> [[1]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[2]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d4790c18] #> #> [[3]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d4790e48] #> #> [[4]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d47913f8] #> #> [[5]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d4791970] #> #> [[6]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d4791cb8] #> #> [[7]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d4792000] #> #> [[8]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d47926c8] #> #> [[9]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d478cba8] #> #> [[10]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d478cd30] #> #> [[11]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d478ce10] #> #> [[12]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d3c555a0] #> #> [[13]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[14]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[15]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[16]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[17]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[18]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[19]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[20]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[21]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[22]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[23]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[24]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[25]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
g <- function(trim) identity(identity(fn(trim))) g(2)
#> [[1]] #> <frame 25> (24) #> expr: g(2) #> env: [local 0x5613d2d6dc88] #> #> [[2]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[3]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d2d6dac8] #> #> [[4]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d2d6d898] #> #> [[5]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d2d6d2e8] #> #> [[6]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d2d6cd70] #> #> [[7]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d2d6ca28] #> #> [[8]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d4303be0] #> #> [[9]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d43034a8] #> #> [[10]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d4303278] #> #> [[11]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d43027f8] #> #> [[12]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d4302718] #> #> [[13]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d34c2358] #> #> [[14]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[15]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[16]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[17]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[18]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[19]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[20]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[21]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[22]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[23]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[24]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[25]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[26]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"
g(3)
#> [[1]] #> <frame 24> (23) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613cfcd7010] #> #> [[2]] #> <frame 23> (13) #> expr: eval(expr, envir, enclos) #> env: [local 0x5613d1a34fa8] #> #> [[3]] #> <frame 22> (13) #> expr: withVisible(eval(expr, envir, enclos)) #> env: [local 0x5613d1a34d78] #> #> [[4]] #> <frame 21> (13) #> expr: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, <...> #> env: [local 0x5613d1a347c8] #> #> [[5]] #> <frame 20> (19) #> expr: doTryCatch(return(expr), name, parentenv, handler) #> env: [local 0x5613d1a341e0] #> #> [[6]] #> <frame 19> (18) #> expr: tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> env: [local 0x5613d1a33e98] #> #> [[7]] #> <frame 18> (17) #> expr: tryCatchList(expr, classes, parentenv, handlers) #> env: [local 0x5613d1a37910] #> #> [[8]] #> <frame 17> (16) #> expr: tryCatch(expr, error = function(e) { <...> #> env: [local 0x5613d1a37248] #> #> [[9]] #> <frame 16> (15) #> expr: try(f, silent = TRUE) #> env: [local 0x5613d1a37018] #> #> [[10]] #> <frame 15> (13) #> expr: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, <...> #> env: [local 0x5613d1a36e90] #> #> [[11]] #> <frame 14> (13) #> expr: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, <...> #> env: [local 0x5613d1a36db0] #> #> [[12]] #> <frame 13> (12) #> expr: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, <...> #> env: [frame 0x5613d1a49a70] #> #> [[13]] #> <frame 12> (11) #> expr: evaluate::evaluate(code, child_env(env), new_device = TRUE) #> env: [frame 0x5613d071e418] #> #> [[14]] #> <frame 11> (10) #> expr: downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, <...> #> env: [frame 0x5613d0720a00] #> #> [[15]] #> <frame 10> (9) #> expr: highlight_examples(code, topic, env = env) #> env: [frame 0x5613d072d068] #> #> [[16]] #> <frame 9> (8) #> expr: run_examples(tags$tag_examples[[1]], env = new.env(parent = globalenv()), <...> #> env: [frame 0x5613d07c6328] #> #> [[17]] #> <frame 8> (6) #> expr: data_reference_topic(topic, pkg, examples = examples, run_dont_run = run_dont_run) #> env: [frame 0x5613d0eb25b0] #> #> [[18]] #> <frame 7> (6) #> expr: withCallingHandlers(data_reference_topic(topic, pkg, examples = examples, <...> #> env: [frame 0x5613d0eb1e08] #> #> [[19]] #> <frame 6> (5) #> expr: .f(.x[[i]], ...) #> env: [frame 0x5613d0ed15b8] #> #> [[20]] #> <frame 5> (4) #> expr: purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, <...> #> env: [frame 0x5613d13ff368] #> #> [[21]] #> <frame 4> (3) #> expr: build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d1251d38] #> #> [[22]] #> <frame 3> (2) #> expr: build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, <...> #> env: [frame 0x5613d0943bf8] #> #> [[23]] #> <frame 2> (1) #> expr: build_site(pkg, devel = FALSE, preview = FALSE, install = FALSE, <...> #> env: [frame 0x5613d09411d8] #> #> [[24]] #> <frame 1> (0) #> expr: pkgdown::deploy_to_branch(new_process = FALSE) #> env: [frame 0x5613cdd7e6b0] #> #> [[25]] #> <frame 0> [global] #> expr: NULL #> env: [global] #> #> attr(,"class") #> [1] "ctxt_stack" "stack"