[R] Problem with invoking R from the command line (Windows Vista)

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jul 21 19:16:55 CEST 2010


On Wed, Jul 21, 2010 at 12:55 PM, Camster <c.szmaragd at googlemail.com> wrote:
>
> Dear all
>
> I am running in a problem when trying to run R from Windows command line.
> I am runnning Windows Vista, R-2.10.1.
>
> I have a script I would like to run remotely from another program. As it did
> not work, I thought I would test the script from the Windows command line
> which highlighted a problem.
> When I open the command line and type R at the prompt (or any other variant
> (R CMD BATCH, Rgui.exe or Rterm.exe), I get the error message:
> "'Rscript' is not recognized as an internal or external command,
> operable program or batch file."
>
> if I move to the R directory (cd usr\R\R-2.10.1\bin), and try running the
> script ( R < "myscript.R" --vanilla)
>  it works fine.
> I thought the problem may come from the environment variables (tried
> specifying explicit location of R.exe), but this did not solve the problem.
> I also re-install R but that did not help either.
>
> I cannot think of anything else.
> I have read the R installation and rwfaq notes, and look through the posts
> but I cannot find any suggestion on how to fix the bug.
>
> If anyone can suggest anything, that will be much appreciated.
>
> Many thanks
>
> Camille
>
> PS: I am also running R on another machine (Windows XP) and I don't have a
> similar problem!
>

If you don't want to change your path you can use Rgui.bat, Rterm.bat,
etc. in the batchfiles distribution at
   http://batchfiles.googlecode.com
Just put any of them that you wish to use on your path (they are self
contained Windows batch files, i.e. with no dependencies) and then
when you invoke any of them they will look up R in the registry and
run the corresponding command.



More information about the R-help mailing list