Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot run R.exe in Powershell

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

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?

like image 928
BroVic Avatar asked Jul 20 '26 18:07

BroVic


1 Answers

To start R in powershell:

R.exe
like image 114
stevec Avatar answered Jul 23 '26 08:07

stevec