Camster
2010-Jul-21 16:55 UTC
[R] Problem with invoking R from the command line (Windows Vista)
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! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-invoking-R-from-the-command-line-Windows-Vista-tp2297429p2297429.html Sent from the R help mailing list archive at Nabble.com.
Duncan Murdoch
2010-Jul-21 17:09 UTC
[R] Problem with invoking R from the command line (Windows Vista)
On 21/07/2010 12:55 PM, Camster 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." >This is a sign that your PATH environment variable doesn't include the directory RHOME\bin.> 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. >You don't say exactly what you tried, but if you tried changing your PATH, you should try again, and verify that the change is in place in the session where you're trying to run R. Duncan Murdoch> 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! > > > >
Gabor Grothendieck
2010-Jul-21 17:16 UTC
[R] Problem with invoking R from the command line (Windows Vista)
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.
Camster
2010-Jul-21 18:27 UTC
[R] Problem with invoking R from the command line (Windows Vista) - - SORTED!
Thanks for suggestion. It was indeed a path problem. I move R into a directory without spaces and added the directory RHOME\bin in the Path environment variable. All sorted. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-invoking-R-from-the-command-line-Windows-Vista-tp2297429p2297552.html Sent from the R help mailing list archive at Nabble.com.