[Rd] Nested tracing with custom callback

Evan James Patterson
Wed, 13 Jul 2016 03:20:24 -0000

Hi all,

I would like to install a trace function that gets executed whenever *any* R
function is called. In Python, for example, this functionality is provided by
the `sys.settrace` function.

I am not aware of any public interface, at the R or C level, that can accomplish
this. The `trace` function is inadequate because it does not support nested
functions. The `Rprof` function provides only statistical profiling.

Any advice would be appreciated. I'm not afraid to dig into R's
internals if that's what it takes.

Thanks,
Evan