Learn R Programming

berryFunctions (version 1.12.3)

traceCall: call stack of a function

Description

trace the call stack e.g. for error checking and format output for do.call levels

Usage

traceCall(skip = 0)

Arguments

skip
Number of levels to skip in traceback

Value

Character string with the call stack

Warning

In do.call settings with large objects, tracing may take a lot of computing time.

See Also

checkFile for example usage

Examples

Run this code
lower <- function(a, s) warning(traceCall(s), "final value is: ", a+10)
upper <- function(b, skip=0) lower(b+5, skip)
upper(3)
upper(3, skip=1) # traceCall skips last level (warning)
upper(3, skip=4) # now the stack is empty
upper(3, skip=-1) # get one more level down
is.error(upper("four"))

Run the code above in your browser using DataLab