[R] Debugging functions defined (locally) inside another functions

Iago Giné Vázquez |@go@g|ne @end|ng |rom @jd@e@
Fri Apr 12 14:22:03 CEST 2024


To be precise, in the case I am looking this time f is not a function, but

f <- ggplot2::ggproto(...)

So debug(f) produces
Error in debug(f) : argument must be a function

Iago
________________________________
De: R-help <r-help-bounces using r-project.org> de part de Iago Gin� V�zquez <iago.gine using sjd.es>
Enviat el: divendres, 12 d�abril de 2024 14:15
Per a: r-help using r-project.org <r-help using r-project.org>
Tema: [R] Debugging functions defined (locally) inside another functions

Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package.
So I have

f <- function(whatever){
   ...
   g <- function(whatever2){
     ...
   }
   ...
}

If I wanted to debug some thing directly inside f I would do debug(f). But this does not go inside g code. On the other hand, debug(g) does not work as g is not a defined function in the namespace of the package.

Is there some way to debug errors inside g?

Thank you in advance.

All the best,
Iago

        [[alternative HTML version deleted]]

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list