有没有办法在R studio环境中逐行调试代码?
我知道有断点、下一步、继续等来调试。但我正在寻找像 Visual Studio 中的那样的逐行调试选项。
谢谢
对于像我这样习惯了其他 IDE 的 R-Studio 新手:
a) 通过单击边框或按Shift+F9
(=>显示红色断点点)
b) 相当于其他IDE中的“调试”:
- Click
source
or
- Press
Ctrl+Shift+Enter
or
- 启用
source on save
并保存
c) 看一下Console
看法。有常见的调试选项:
- 执行下一行
F10
- 进入函数
Shift+F4
- 完成功能
Shift+F6
- 继续
Shift+F5
- 停止调试
Shift+F8
(不幸的是,我没有找到一种方法来调整这些选项的快捷键。它们没有在“工具=>修改键盘快捷键”下列出。)
d)调试时似乎没有“悬停在表达式上”功能。你可以看看Environment
查看变量的值并在调试时使用控制台计算表达式。
如果要运行脚本而不进行调试且不清除断点,请选择所有行Ctrl+A
并使用“运行”按钮。 (对我来说似乎很复杂......我希望有一个额外的运行按钮或快捷键,但找不到。)
如果没有选择,则运行按钮只执行当前行。您可以按几次该按钮来单步执行代码并查看相应的控制台输出(=伪调试)。
另请参阅文档:
https://support.rstudio.com/hc/en-us/articles/200484448-编辑和执行代码 https://support.rstudio.com/hc/en-us/articles/200484448-Editing-and-Executing-Code
https://support.rstudio.com/hc/en-us/articles/205612627-Debugging-with-RStudio https://support.rstudio.com/hc/en-us/articles/205612627-Debugging-with-RStudio
以及相关问题:
- 禁用 RStudio 中的所有断点 https://stackoverflow.com/questions/32959164/disable-all-breakpoints-in-rstudio
- 在 R 中调试不同源文件中的函数 https://stackoverflow.com/questions/12516192/debugging-a-function-in-a-different-source-file-in-r
- Rstudio 调试 - 缺少进入按钮的步骤 https://stackoverflow.com/questions/32395122/rstudio-debug-missing-step-into-button
- https://support.rstudio.com/hc/en-us/community/posts/202156378-how-do-i-clear-the-console- https://support.rstudio.com/hc/en-us/community/posts/202156378-how-do-i-clear-the-console-
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)