Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rstudio's traceback() does not work interactively anymore

I just started with debugging in rstudio. At the beginning everything worked as described here.

enter image description here

After I used browser(), I cannot get back to this status, that means there is no interactive field, where I can press the hide traceback or return with debug button. Does anybody know, what is going wrong?

  • Suggestions above do not work.
  • traceback() works but the message is not interactive anymore.
  • options(error = function(){.rs.breakOnError(TRUE)}) from here https://support.rstudio.com/hc/en-us/community/posts/202296047-error-recovery sets the value to TRUE, but still no interactive traceback appears.

RStudio Version

platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 2.2
year 2015
month 08
day 14
svn rev 69053
language R
version.string R version 3.2.2 (2015-08-14) nickname Fire Safety

Please let me know if you also need all options() settings.

Edit November 2018: Run a script with an error an interactive traceback active.

getOption("error")
(function () 
{
    .rs.recordTraceback(FALSE, 5, .rs.enqueueError)
})()

Destroy interactive traceback (No idea, what I did):

getOption("error")
(function () 
{
    .rs.recordTraceback(FALSE, 5, .rs.enqueueError)
})()

Thus, settings are the same and it unclear what happens...

like image 426
Christoph Avatar asked Nov 09 '22 17:11

Christoph


1 Answers

I had the same behavior. After programmatically setting the error option in R to browser, traceback or recover, the button in RStudio (Debug/On Error) didn't work anymore.

To resolve this I had to first reset the error option to it's default value NULL. After that I could get back the interactive debugger.

The following resets the option first to NULL and then sets the option to the behavior that you get with selecting (Debug/On Error/Error Inspector) in RStudio.

options(error = NULL)
options(error = function(){.rs.recordTraceback(TRUE)})
like image 83
symbolrush Avatar answered Nov 15 '22 08:11

symbolrush