[Rd] Nested tracing with custom callback

Evan James Patterson epatters at stanford.edu
Wed Jul 13 05:20:24 CEST 2016


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



More information about the R-devel mailing list