2017-07-25 44 views
-1

我发现这个答案,我以前在这里讨论一个问题:How to get dialog/message box working in executable R file如何实现这个解决方案使R脚本交互?

答案就在这里: https://thesquareplanet.com/blog/interactive-r-scripts/

具体该位:

We can use this to provide an interactive R script executor in /usr/local/bin/Rint: #!/bin/sh f=$1; shift; env "R_PROFILE_USER=$f" "[email protected]" R --no-save -q 

我的问题是,我什么都不知道关于命令提示符或批处理文件。那么这行代表什么意思,我只是将它粘贴到命令提示符中,然后将“#!/ usr/local/bin/Rint”添加到我的可执行R脚本的顶部?

回答

0

此行不适用于Windows cmd.exe外壳程序。这是针对UNIX/Linux shell的。

我们可以用它来提供在/ usr/local/bin目录/ RINT的互动[R脚本执行:

#!/bin/sh 
f=$1; 
shift; 
env "R_PROFILE_USER=$f" "[email protected]" 
R --no-save -q 
+0

谢谢,我接受了你的回答。你知道在Windows 10上有没有办法做到这一点? – user5720052

+0

我不知道R是否足以知道这是否可以在Windows上完成。我将删除'cmd'和'windows'标签并添加'shell'标签。 – lit

相关问题