我知道关于这个问题有很多问题,但我已经尝试了一切,我想我只是不明白命令行在 Windows 中是如何工作的。我有一个文件保存在桌面上的文件夹中,假设:
C:\Users\abika_000\Desktop\R models\myfile.R
这是我的 R/bin 或 Rscript/bin 的目录:
C:\Program Files\R\R-3.1.0\bin
我想使用 cmd 提示符运行此代码。我该怎么做呢?
我已经从下面的问题中尝试了这个解决方案,但无论我做什么,我都会不断收到错误:
我输入的内容:
> R CMD BATCH C:\Users\abika_000\Desktop\R models\myfile.R
> Rscript C:\Users\abika_000\Desktop\R models\myfile.R
我得到的错误是:
'R' is not recognized as an internal or external command, operable program or batch file
'Rscript' is not recognized as an internal or external command, operable program or batch file
编辑::
归功于辉煌和菲尔。我最终通过输入以下内容来修复它:
> "C:\Program Files\R\R-3.1.0\bin\"R CMD BATCH "C:\Users\abika_000\Desktop\R models\myfile.R"
我为这个可怜的问题道歉。我只是不确定如何在尝试使用 R CMD BATCH 或 Rscript 时使用 cmd 提示符 /directories