Search code examples
rdebuggingr-markdownknitrrdebug

Is there a way to debug a function when rendering an Rmarkdown document?


I am trying

debug(myFunction)

and

res <- rmarkdown::render("file_using_myFunction.Rmd", output_format = "all", envir = new.env())

It enters the browser, but when I try to evaluate anything inside the browser, there is no output:

enter image description here

Is there some way to get debugging browser to work with rmarkdown::render?

Thank you!


Solution

  • The output has been redirected internally, so you won't see any output in the R console. To stop the redirect, you can first call sink().