简体   繁体   中英

Debug certain lines in RTVS (R Tools for Visual Studio)

Currently the only way to debug in RTVS is to first attach the debugger and then source the file , as shown in this official manual . However, this is rather inconvenient, since my script usually expands to hundreds of lines and it will take forever for the debugger to execute to the breakpoint, which usually at the last of the script.

The only workaround I can come up with now is to comment all the above lines before the codes of interests. But, is there any elegant way to achieve that?

So far there is no shortcut for it yet, to debug the certain line in R, we still have to launch the debugger with the code in script.R by either selecting the Source startup file button on the toolbar, selecting the Debug > Source startup file menu items , or pressing F5 . Visual Studio enters its debugging mode and starts running the code. It stops on the line where you set the breakpoint:

https://docs.microsoft.com/en-us/visualstudio/rtvs/getting-started-with-r#debugging-your-code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM