Dear R experts,

recently I tried to debug a R function with an internal lapply call.
When debugging I seem not to be able to use the "n" command to debug the
inner function called by lapply.
How could I achieve this?

*For example:*
test <- function( ) {
  lapply( 1:3, function( x ) x + 1 )
}
debug( test )

*Start debug:*
> test()
debugging in: test()
debug bei #1:{
    lapply(1:10, function(x) x + 1)
}
Browse[2]> n
debug bei #2:lapply(1:10, function(x) x + 1)

*The next "n" does not allow me to inspect the inner function,*
*but gives me the result directly:*
Browse[2]> n
exiting from: test()
[[1]]
[1] 2

[[2]]
[1] 3

[[3]]
[1] 4

Can anyone help me, please?
Kind regards!

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to