我在testrscript.txt文件中使用了以下内容。
getwd()
a <- 5 + 6
a
s
b<-10+20
b
我使用以下命令通过命令提示符
运行此r脚本D:\>R.exe CMD BATCH testrscript.txt out.txt
执行此命令后,我在out.txt
中得到以下输出> getwd()
[1] "D:/"
> a <- 5 + 6
> a
[1] 11
> s
Error: object 's' not found
Execution halted
我期待以下输出,即在错误行执行后继续执行而不是执行停止我的预期,如下所示
> getwd()
[1] "D:/"
> a <- 5 + 6
> a
[1] 11
> s
Error: object 's' not found
> b<-10+20
> b
[1] 30
系统信息窗口8 64位机器 我已经提到以下链接来解决这个问题。 http://lists.r-forge.r-project.org/pipermail/statet-user/2009-July/000180.html 但我无法做到这一点。如何在r终端中执行错误行后继续执行?提前谢谢。