inst/examplepkg/R/complex_call_stack.R

#' Example of a function that calls down into a deeply nested call stack
#' @export
complex_call_stack <- function(x) {
  nested_function(x)
}

#' An example of a non-exported function in a deep call stack
#'
nested_function <- function(x) {
  deeper_nested_function(x)
}

#' Example of a function within a deeply nested call stack
#' @export
deeper_nested_function <- function(x) {
  recursive_function(x)
}

#' An example of an internal recursive function
#'
recursive_function <- function(x, i = 3L) {
  if (i <= 0L) return(x)
  recursive_function(x, i - 1L)
}

Try the covtracer package in your browser

Any scripts or data that you put into this service are public.

covtracer documentation built on Sept. 12, 2024, 7:40 a.m.