Hello all, I recently installed rpy2 so that I could use R through Python. However, R was not recognized in the command line. So I decided to add it to the PATH variables. But it just doesnt work.... And what I mean by it doesnt work is : No matter what I type at the prompt in DOS- be it R, Rcmd, R CMD, Rscript- it is not recognized as a command. Path variables used : 1. %R_HOME% --> C:\Program Files\R\R 2.12.1\ 2. %R_HOME%\bin 3. %R_HOME%\bin\i386 4. Some Batchscripts I found online that recognize the R.exe in \bin\i386 but only if I run the batch file...its not natively recognized (if I were to type 'R' at the prompt in DOS, its not recognized) I would appreciate any help in this matter. Or should I do something else so that I can try rpy2? Python version 2.6.6 R 2.12.1 rpy2 2.0.8 -- Aaditya Nanduri aaditya.nanduri@gmail.com [[alternative HTML version deleted]]
Hi Aaditya, I assume you are running some variant of Windows and by the "prompt in DOS" you are using cmd.exe. Perhaps you are already, but from your examples it looks like either A) you are not in the same directory as R or B) are not adding the path to R in the command. For example, on Windows I always install R under C:\R\ so for me inside cmd.exe: C:\directory> C:\R\R-devel\bin\x64\R [[[R starts here]]] alternately you could switch directories over and then just type "R" at the console: C:\directory> cd C:\R\R-devel\bin\x64\ C:\R\R-devel\bin\x64> R [[[R starts here]]] or since you have set the environment variables: C:\directory> %R_HOME%\bin\x64\R [[[R starts here]]] Alternately, edit the PATH environment variable in Windows and add the path to R (i.e., R_HOME\bin\i386\ or whatever it is for you), and you should be able to just enter "R" at the command prompt and have it start. Cheers, Josh On Tue, Jan 4, 2011 at 9:39 PM, Aaditya Nanduri <aaditya.nanduri at gmail.com> wrote:> Hello all, > > I recently installed rpy2 so that I could use R through Python. > > However, R was not recognized in the command line. > > So I decided to add it to the PATH variables. But it just doesnt work.... > And what I mean by it doesnt work is : No matter what I type at the prompt > in DOS- be it R, Rcmd, R CMD, Rscript- it is not recognized as a command. > > Path variables used : > 1. %R_HOME% --> C:\Program Files\R\R 2.12.1\ > 2. %R_HOME%\bin > 3. %R_HOME%\bin\i386 > 4. Some Batchscripts I found online that recognize the R.exe in \bin\i386 > but only if I run the batch file...its not natively recognized (if I were to > type 'R' at the prompt in DOS, its not recognized) > > I would appreciate any help in this matter. > Or should I do something else so that I can try rpy2? > > Python version 2.6.6 > R 2.12.1 > rpy2 2.0.8 > > > -- > Aaditya Nanduri > aaditya.nanduri at gmail.com > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
On 12.01.2011 18:13, Daniel Nordlund wrote:>> -----Original Message----- >> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] >> On Behalf Of Aaditya Nanduri >> Sent: Wednesday, January 12, 2011 8:44 AM >> To: Uwe Ligges >> Cc: r-help at r-project.org; spector at stat.berkeley.edu >> Subject: Re: [R] R not recognized in command line >> >> Im sorry for the late reply. >> >> The output to echo %PATH% : >> >> C:\GTK\bin; C:\Program Files\MiKTeX 2.8\miktex\bin ;C:\Windows\system32 >> ;C:\Windows >> ;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; >> C:\Program >> Files\MATLAB\R2008a\bin; C:\Program Files\MATLAB\R2008a\bin\win32; >> C:\Program Fil >> es\QuickTime\QTSystem\; C:\MinGW\bin;c:\Program Files\Microsoft SQL >> Server\100\To >> ols\Binn\; c:\Program Files\Microsoft SQL Server\100\DTS\Binn\; C:\Program >> Files\ >> R\R-2.12.1\bin\; C:\Program Files\Python27; C:\Program Files\SSH >> Communications Security\SSH Secure Shell;C:\Python26;C:\Python26\Scripts >> > > For your system, the path to R should probably be > > C:\Program Files\R\R-2.12.1\bin\i386Right, additionally, the output from above is wrong anyway: Entries must not end on "\", and blanks before or after ";" are not allowed. Uwe> Hope this is helpful, > > Dan > > Daniel Nordlund > Bothell, WA USA > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.