Thanks a lot both Duncan and Ivan,
I will keep that example in mind, Duncan, great!
Best regards,
Iago
De: Duncan Murdoch
Enviat el: divendres, 12 d�abril de 2024 15:36
Per a: Iago Gin� V�zquez ; r-help@r-project.org
Tema: Re: [R] Debugging functions defined
On 12/04/2024 8:15 a.m., Iago Giné Vázquez wrote:
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 di
В Fri, 12 Apr 2024 12:53:02 +
Iago Giné Vázquez пишет:
> How should I call trace() if f was a function?
Let the tracer be quote(debug(g)) and use as.list(body(f)) to determine
where it should be injected:
f <- function() {
message('exists("g") so far is ', exists('g'))
g <- function() {
ing a call to debug(g) after it's created.
How should I call trace() if f was a function?
Best regards,
Iago
De: Ivan Krylov
Enviat el: divendres, 12 d��abril de 2024 14:38
Per a: Iago Gin�� V��zquez
A/c: r-help@r-project.org
Tema: Re: [R] Debugging functio
В Fri, 12 Apr 2024 12:15:07 +
Iago Giné Vázquez пишет:
> 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
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 de part de Iago Gin� V�zquez
Enviat el: divendres, 12 d�abril de 2024 14:
6 matches
Mail list logo