Running R in Batch Mode on Linux: Output Issues

让人想犯罪 __ 提交于 2019-12-03 16:40:41

nohup runs a command in the background, makes it ignore signals telling it to stop (e.g., when you log off), and redirects the output to a file. But it has to be an executable command: you probably have error messages in nohup.out telling you that BatchProgram.R could not be run.

The following should work:

nohup Rscript ./BatchProgram.R &

The solution is tested, u can try also making 'nohup' version of it, but what will be presented suits me well. Make bash script as follows (for example run_R.sh):

#!/bin/sh
R CMD BATCH --slave ./_your_R_script_name.R &
exit 0

then, make it runnable

chmod +x run_R.sh

and run file like,

./run_R.sh

sometimes you can get only blinking cursor (depends on what linux distro you're working) but simple press "enter" to continue

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