如何在R-studio的函数体中设置断点? [英] How to set a breakpoint in function body in R-studio?

查看:129
本文介绍了如何在R-studio的函数体中设置断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 R 脚本,它调用我编写的函数.但是,当我执行脚本时,程序不会在函数体的调试点处停止.调试点只有在主脚本文件中设置时才起作用.我正在使用 R-studio IDE,但是任何通用的解决方案也将不胜感激.

I have an R script which calls a function written by me. However, when I execute the script, the program doesn't stop at the debug point in the function body. The only time debug points work is when they are set in the main script file. I am using R-studio IDE, however any general solution would also be appreciated.

推荐答案

如果您处理多个文件,则必须使用

If you work on multiple files, you have to source R files with

debugSource("C:/Users/...")

代替

source("C:/Users/...")

来自你的主脚本

这篇关于如何在R-studio的函数体中设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆