繁体   English   中英

如何使用 .Rprofile 使 q('yes') 成为 R 中的默认退出行为?

[英]How to make q('yes') the default quitting behavior in R using .Rprofile?

我希望能够在 R 中键入q()并让 R 退出,而不是被提示我是否想退出。

是否有一些代码可以放入我的.Rprofile文件中以实现此目的?

如果我不必在我的工作区中浮动自定义函数,我会更喜欢。

在您的 Rprofile.site 文件中:

q <- function(save = "yes", status = 0, runLast = TRUE){
.Internal(quit(save, status, runLast))
#<environment: namespace:base>
}

使用 R --vanilla 效果更好

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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