41

In RStudio, I started a debug mode by

debug(ls)
ls()

Then I do not know how to end this mode. The prompt changed to

Browse[2]>

How can I end this debugging mode?

Scransom
  • 3,175
  • 3
  • 31
  • 51
user67275
  • 1
  • 9
  • 38
  • 64

2 Answers2

78

First quit debugging the function with Q at the Browse[2]> prompt as jbaums tells you in his comment. This takes you back to the > prompt. Now turn off the debugging on ls with this command:

undebug(ls)

?debug is helpful for this sort of thing.

Mus
  • 7,290
  • 24
  • 86
  • 130
Matthew Lundberg
  • 42,009
  • 6
  • 90
  • 112
  • Wow. R must have been developed on a different planet. You can't just hit ctrl-d or type "exit", "out of here!", you need to remember what the function name is. R is so alien and we'll be stuck with it for many years to come... – Max Jun 23 '21 at 09:05
  • Part of the problem is that hardly anyone uses R itself, most users are on RStudio and a lot of these features are simple buttons in RStudio, rather than these totally obscure commands. – Max Jun 23 '21 at 09:11
16

Use debugonce() instead of debug(). As the name suggests, this will only take the function through debug mode once. When in debug mode hit continue to run through the end or the next breakpoint or use the stop button to end the debug session.

sriramn
  • 2,338
  • 4
  • 35
  • 45