这是R 3.5中的错误吗?

Ker*_*son 11 windows r

当我为R版本3.5调用Rscript.exe时,如果文件名或路径中有空格,则无法打开该文件.我用代码保存了2个文件:

cat("What do you get when you multiply 6 * 9?")

C:\ foo bar.RC:\ foo_bar.R

当我在DOS命令窗口中尝试使用版本3.4.3和3.5运行它们时:

C:\>"C:\Program Files\R\R-3.4.3\bin\x64\Rscript.exe" "C:\foo bar.R"
What do you get when you multiply 6 * 9?
C:\>"C:\Program Files\R\R-3.4.3\bin\x64\Rscript.exe" "C:\foo_bar.R"
What do you get when you multiply 6 * 9?
C:\>"C:\Program Files\R\R-3.5.0\bin\x64\Rscript.exe" "C:\foo bar.R"
Fatal error: cannot open file 'C:\foo': No such file or directory


C:\>"C:\Program Files\R\R-3.5.0\bin\x64\Rscript.exe" "C:\foo_bar.R"
What do you get when you multiply 6 * 9?
C:\>
Run Code Online (Sandbox Code Playgroud)

当我尝试在版本3.5.0的R中使用名称中的空格运行文件时,会出现致命错误,表示没有此类文件.

Ker*_*son 6

感谢Edward Carney,我通过电子邮件发送了您列出的地址,并得到Tomas的回复,确认这是一个错误,并提供解决方法,直到修复为止:

在此问题得到修复之前的快速解决方法是添加一个没有空格的额外第一个参数,例如

Rscript --vanilla "foo bar.R"
Run Code Online (Sandbox Code Playgroud)

所有系统都存在问题,而不仅仅是Windows.

现在已经在开发版本中对此进行了更正,并且有一个适用于Windows的二进制版本:https: //cran.r-project.org/bin/windows/base/rdevel.html

它在修补版本中也得到了纠正,并且有一个适用于Windows的二进制版本:https: //cran.r-project.org/bin/windows/base/rpatched.html