如何运行R脚本强制会话是交互式的.文档?interative说--ess并--interactive控制了这一点,但我没有看到任何影响.
视窗:
C:\Program Files\R\R-3.0.1\bin>R -e "interactive()" --ess -s
[1] FALSE
Run Code Online (Sandbox Code Playgroud)
苹果电脑:
$ R -e "interactive()" --interactive -s
[1] FALSE
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
编辑:我想可以破解可能适用于某些事情的基本命名空间(如install.packages).但这对解决方案来说是一个糟糕的借口......
$ R -e "unlockBinding('interactive',as.environment('package:base'));assign('interactive',function() TRUE,envir=as.environment('package:base'));base::interactive()" --interactive -s
[1] TRUE
Run Code Online (Sandbox Code Playgroud) r ×1