Home > Blockchain >  R studio: cannot debug/write in file with browser() during a function call
R studio: cannot debug/write in file with browser() during a function call

Time:01-18

Function 1 is called from the main script and code execution is halted by the command

browser()

However the file seems locked and I cannot type and code whilst in debug mode. However I would like to debug with all the parsed arguments' values available.

Scope in R is global, but still, I want to debug while the code has all the values available for all the variables calculated so far...

CodePudding user response:

It isn't clear what you mean by 'debug'.

You cannot edit function code while it is being executed. You can print the values of arguments and variables, and perform computations on them while stopped at a breakpoint (=="browser()") - from the R console.

You tagged the question RStudio - if indeed you're using it and all you need is to observe the values of variables calculated so far - you don't even need to type their name at the console, just switch to the 'Environment' pane (by default at the top right).

  •  Tags:  
  • Related