Learn R Programming

typetracer (version 0.2.3)

clear_traces: Clear previous traces

Description

Traces are by default appended to previous traces. This function can be used to clean those previous ones, to enable subsequent calls to generate new traces that are not appended to previous ones.

Usage

clear_traces()

Arguments

Value

(Invisibly) A single logical value indicating whether or not traces were successfully cleared.

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 ()
print (x)

# Then call 'clear_traces' to remove them:
clear_traces ()
# Trying to load again wil then indicate 'No traces found':
x <- load_traces ()
# Traces should also always be "uninjected":
uninject_tracer (f)

Run the code above in your browser using DataLab