get_fun_calling_chain: Return the chain of calling functions

Description Usage Arguments Value

View source: R/get_fun_calling_chain.r

Description

Return a data frame with the stack or chain of function calls, or optionally the information on one particular function in this chain.

Usage

1
get_fun_calling_chain(n = NULL, showParameters = FALSE, silent = TRUE)

Arguments

n

non-negative integer specifying the level of interest in the function calling chain, where 0 means the function calling get_fun_calling_chain. It defaults to NULL, in which case the full chain is returned.

showParameters

flag indicating whether the parameters of the function call should also be shown in the output.

silent

whether to run in silent mode. If FALSE, the calling chain is shown in an intuitive way. It defaults to TRUE.

Value

If n=NULL (the default) a data frame with the function calling chain information, with the following columns:

The rownames of the data frame are the stack level of the function calls in the chain, from 0 up to the number of functions in the chain, where 0 indicates the current function (i.e. the function that called get_fun_calling_chain).

The functions in the data frame are sorted from most recent to least recent call, much like the common way of displaying the function stack in debug mode.

If the function is NOT called from within a function, NULL is returned.

If n is not NULL and is non-negative, the environment and the function name (including parameters if showParameters=TRUE) separated by a $ sign are returned (ex: env1$f(x = 3, n = 1)).

if n < 0 or if n is larger than the function calling chain length, NULL is returned.


envnames documentation built on Dec. 8, 2020, 9:07 a.m.