Question:
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.
This is the error I get when I do R CMD BATCH
1 2 |
Invoke-History: A positional parameter cannot be found that accepts the argument 'BATCH' |
I later realised that r
is an alias that returns the immediate past command, hence my inability to run R.
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?
Answer:
To start R in powershell:
1 2 |
R.exe |