Learn R Programming

typetracer (version 0.2.3)

inject_tracer: Inject parameter tracer into one function

Description

Inject parameter tracer into one function

Usage

inject_tracer(f, trace_lists = FALSE)

Value

Nothing (will error on fail).

Arguments

f

A function (that is, an object of class "function", and not a character string).

trace_lists

If TRUE, trace into any nested list parameters (including data.frame-type objects), and return type information on each list component. The parameter names for these list-components are then specified in "dollar-notation", for example 'Orange$age'.

Examples

Run this code
f <- function (x, y, z, ...) {
    x * x + y * y
}
inject_tracer (f)
val <- f (1:2, 3:4 + 0., a = "blah")
x <- load_traces ()

# Traces should always be "uninjected":
uninject_tracer (f)
# Traces may also be removed:
clear_traces ()

Run the code above in your browser using DataLab