Rscript execution error: No such file or directory

半城伤御伤魂 提交于 2019-12-10 18:35:34

问题


The binary of Rscript is available but when I try to use it I get:

Rscript helloworld.r

Rscript execution error: No such file or directory

If I just do Rscript, it brings the help/usage for it through.

R CMD BATCH is working fine.

I tried adding shebang lines in the R code at the start but it didn't work.

#!/sys_apps_01/R/R-3.2.0/bin/R

#!/sys_apps_01/R/R-3.2.0/bin/Rscript


回答1:


It's likely this was installed to (configured for) another directory and then moved after installation. Afterwards Rscript won't be able to find the (hardcoded?) R binary. I just had the same problem, which could be solved by reinstalling R.

Andreas




回答2:


As in your case, this was caused by me moving R (in order to try to use it in an AWS lambda function).

I resorted to doing the equivalent call on R itself:

./R --slave --no-restore --file=TheScript.R


来源:https://stackoverflow.com/questions/39832110/rscript-execution-error-no-such-file-or-directory

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