我發現這個答案,我以前在這裏討論一個問題: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腳本的頂部?
謝謝,我接受了你的回答。你知道在Windows 10上有沒有辦法做到這一點? – user5720052
我不知道R是否足以知道這是否可以在Windows上完成。我將刪除'cmd'和'windows'標籤並添加'shell'標籤。 – lit