inject_tracer {typetracer} | R Documentation |
Inject parameter tracer into one function
Description
Inject parameter tracer into one function
Usage
inject_tracer(f, trace_lists = FALSE)
Arguments
f |
A function (that is, an object of class "function", and not a character string). |
trace_lists |
If |
Value
Nothing (will error on fail).
Note
The tracer is defined in the internal typetracer_header()
function.
This uses an options
variable defined on package load for the current
tempdir
, defining a single location where all traced values are dumped.
This is done via options
to allow both multi-threaded function calls and
calls via callr to be traced.
Examples
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 ()
[Package typetracer version 0.2.2 Index]