gWidgets GUI cannot display when called with R CMD BATCH

我的未来我决定 提交于 2019-12-02 00:24:37

If you run an R script in batch mode (R CMD BATCH) the "interactive flag" is set to false which may trigger this behaviour (no user interaction = do not show any GUI).

You can query the "interactive flag" with the interactive() function in R.

Possible solution: Add the --interactive parameter to the command line.

To test his behaviour create an R script file with the following content:

print(interactive())

If you run this script with

R CMD BATCH --no-save --no-restore  batch_test.R out.txt

You will find the result FALSE in the out.txt file, if you run it with

R --vanilla --interactive  < batch_test.R

You will see a TRUE (so use the last command line as solution - note: without CMD).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!