inject_tracer | R Documentation |
Inject parameter tracer into one function
inject_tracer(f, trace_lists = FALSE)
f |
A function (that is, an object of class "function", and not a character string). |
trace_lists |
If |
Nothing (will error on fail).
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.
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 ()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.