运行build()在RStudio中创buildR包后出错

我正在尝试在Windows 8 Pro上使用RStudio构buildR包。 当我尝试通过运行build()来构build程序包时出现错误:

 "C:/Program Files/R/R-30~1.2/bin/x64/R" --vanilla CMD build "H:\File Assembly\FileAssembler" \ --no-manual --no-resave-data 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Error: Command failed (1) 

我已经安装了MiKTEX并且已经通过以下方式进行了检查:

 Sys.which("pdflatex") pdflatex "C:\\Program Files (x86)\\MIKTEX~1.9\\miktex\\bin\\pdflatex.exe" 

我使用的R版本是: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"

加载库(devtools)和运行find_rtools(T)给出:

 find_rtools(T) Scanning path... ls : c:\Rtools\bin\ls.exe gcc: c:\Rtools\GCC-46~1.3\bin\gcc.exe VERSION.txt Rtools version 3.1.0.1942 Version: 3.1 [1] TRUE 

另外, rtools exes的path是:

 Sys.which("ls.exe") ls.exe "c:\\Rtools\\bin\\ls.exe" Sys.which("gcc.exe") gcc.exe "c:\\Rtools\\GCC-46~1.3\\bin\\gcc.exe" 

并检查R中的path:

 Sys.getenv('PATH') [1] "C:\\Program Files\\R\\R-3.0.2\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\gcc-4.6.3\\bin;……other paths…………;C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\" 

我真的很感谢帮助确定我错过了什么。

这是安装位置路径(C:\ Program Files)中的空间引起的常见错误。 该解决方案以及官方的R建议是,如果您希望能够从源代码安装软件包,则绝对不要将R安装在Windows中具有空格的位置上。

来自http://cran.r-project.org/bin/windows/rw-FAQ.html#How-do-I-install-R-for-Windows_003f

如果您希望能够从源代码构建包,我们建议您选择一个不包含空格的安装路径。

我有同样的问题。

花了一些时间发现,卡巴斯基反病毒软件删除了Rcmd.exe。

一旦我发现它很容易修复。

祝你好运

提供