无法在 Powershell 中运行 R.exe [英] Cannot run R.exe in Powershell
问题描述
我经常发现在命令行(Windows)上运行 R 更有用.然而,当我在 Powershell 中尝试它时,我往往会遇到问题,但这很容易通过首先运行 cmd
来解决,然后它就可以工作了.
I often find it more useful to run R on the command line (windows). However when I try it in Powershell I tend to run into problems, but this is easily overcome by first running cmd
and then it works.
这是我在执行 R CMD BATCH
Invoke-History: A positional parameter cannot be found that accepts the argument 'BATCH'
我后来意识到 r
是一个别名,它返回直接过去的命令,因此我无法运行 R.
I later realised that r
is an alias that returns the immediate past command, hence my inability to run R.
随后,我发现使用可执行文件的完整文件名(即 R.exe
)或使用 Rcmd.exe(即 Rcmd BATCH ...
)都有效.
Subsequently, I found that using the full filename for the executable (i.e. R.exe
) or using Rcmd.exe (i.e. Rcmd BATCH ...
) worked.
不过,我只是好奇,是否有解决方法,以防万一遇到类似的冲突?
However, I'm just curious, is there a work around, in case one runs into similar conflicts?
推荐答案
在 powershell 中启动 R:
To start R in powershell:
R.exe
这篇关于无法在 Powershell 中运行 R.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!