Re: [R] R not recognized in command line
It may very well have been an error in the PATH variable. But, I simply deleted the R_HOME variable and also deleted it from the PATH variable. Then I made a new one with the exact same values as before (but it worked this time). R_HOME = C:\Program Files\R\R-2.12.1 path = ...;%R_HOME%\bin\i386;... R is now recognized as a command. Thank you all very much. Im sorry I could not provide a satisfactory solution On Thu, Jan 13, 2011 at 1:12 AM, Daniel Nordlund wrote: > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > > On Behalf Of Aaditya Nanduri > > Sent: Wednesday, January 12, 2011 9:31 PM > > To: gleyne...@gmail.com > > Cc: r-help@r-project.org; spec...@stat.berkeley.edu; Uwe Ligges > > Subject: Re: [R] R not recognized in command line > > > > @ Daniel Nordlund : I've also tried the dir that you recommended. R is > > still > > not recognized as a command in CMD.exe > > > > @ Uwe Ligges : There are no blanks before or after the semicolon. I added > > them after I copied it so that it would be more legible. And for some of > > the > > dir's in the path, having a backslash at the end still works. However, I > > tried it with and without the backslash for the R_HOME\bin and \bin\i386 > > folders. Nothing seems to work. > > > > @Gene Lynes : I have been using the GUI the whole time so it wasnt too > > hard > > changing the path constantly. And I've also set the R_HOME variable as > > well. > > > > I'm starting to regret clearing the partition that had Ubuntu. Life > > would've > > been so much easier had I not erased it. > > I will definitely let you know if I have any breakthroughs. > > > > Well, (1) either the path is still not correct, (2) R is not installed > where you think it is, or (3) your windows installation is corrupted. > (There are probably other options as well. Let's make sure R is installed > where you think it is. The default directory for 32-bit R-2.12.1 on Windows > (if you accepted the defaults) is > > C:\Program Files\R\R-2.12.1\bin\i386 > > So open up a Windows command shell and execute Rterm by typing the full > path and filename > > "C:\Program Files\R\R-2.12.1\bin\i386\Rterm.exe" > > Make sure you include the double quotes around the complete path (because > of the space in the directory path, and if you changed the installation > directory then you obviously would need to change the command). Does R > start up? If it does, then you still don't have the correct path stored in > the PATH environment variable. If R doesn't start, then it is not installed > where you think it is. Let us know your results are. > > Dan > > Daniel Nordlund > Bothell, WA USA code. > > __ > R-help@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. > -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Aaditya Nanduri > Sent: Wednesday, January 12, 2011 9:31 PM > To: gleyne...@gmail.com > Cc: r-help@r-project.org; spec...@stat.berkeley.edu; Uwe Ligges > Subject: Re: [R] R not recognized in command line > > @ Daniel Nordlund : I've also tried the dir that you recommended. R is > still > not recognized as a command in CMD.exe > > @ Uwe Ligges : There are no blanks before or after the semicolon. I added > them after I copied it so that it would be more legible. And for some of > the > dir's in the path, having a backslash at the end still works. However, I > tried it with and without the backslash for the R_HOME\bin and \bin\i386 > folders. Nothing seems to work. > > @Gene Lynes : I have been using the GUI the whole time so it wasnt too > hard > changing the path constantly. And I've also set the R_HOME variable as > well. > > I'm starting to regret clearing the partition that had Ubuntu. Life > would've > been so much easier had I not erased it. > I will definitely let you know if I have any breakthroughs. > Well, (1) either the path is still not correct, (2) R is not installed where you think it is, or (3) your windows installation is corrupted. (There are probably other options as well. Let's make sure R is installed where you think it is. The default directory for 32-bit R-2.12.1 on Windows (if you accepted the defaults) is C:\Program Files\R\R-2.12.1\bin\i386 So open up a Windows command shell and execute Rterm by typing the full path and filename "C:\Program Files\R\R-2.12.1\bin\i386\Rterm.exe" Make sure you include the double quotes around the complete path (because of the space in the directory path, and if you changed the installation directory then you obviously would need to change the command). Does R start up? If it does, then you still don't have the correct path stored in the PATH environment variable. If R doesn't start, then it is not installed where you think it is. Let us know your results are. Dan Daniel Nordlund Bothell, WA USA code. __ R-help@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.
Re: [R] R not recognized in command line
@ Daniel Nordlund : I've also tried the dir that you recommended. R is still not recognized as a command in CMD.exe @ Uwe Ligges : There are no blanks before or after the semicolon. I added them after I copied it so that it would be more legible. And for some of the dir's in the path, having a backslash at the end still works. However, I tried it with and without the backslash for the R_HOME\bin and \bin\i386 folders. Nothing seems to work. @Gene Lynes : I have been using the GUI the whole time so it wasnt too hard changing the path constantly. And I've also set the R_HOME variable as well. I'm starting to regret clearing the partition that had Ubuntu. Life would've been so much easier had I not erased it. I will definitely let you know if I have any breakthroughs. On Wed, Jan 12, 2011 at 12:20 PM, Gene Leynes > wrote: > Although it could easily be "user error", I never got Rpy or Rpy2 working > an any sort of reliable way. > > However I did learn a couple of things about the Windows PATH > > First, (as others have mentioned) it's easiest to modify the PATH through > the Windows GUI that comes up when you right click "My Computer", and then > you can modify the "Environmental Variables" somewhere. > > Second, here are examples of the syntax for adding things to the PATH from > a DOS command line > path = %PATH%;C:\Program Files\R\R-2.12.1\bin > path = %PATH%;C:\Rtools\bin > path = %PATH%;C:\Rtools\MinGW\bin > path = %PATH%;C:\Rtools\perl\bin > > set R_HOME = C:\Program Files\R\R-2.12.1\ > > Third, I found this R command useful for checking the path from within R: > Sys.getenv()[['PATH']] > > > > On Wed, Jan 12, 2011 at 10:43 AM, Aaditya Nanduri < > aaditya.nand...@gmail.com> wrote: > >> 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 >> >> 2011/1/8 Uwe Ligges >> >> > OK, then let's see if you managed to change the PATH or let is see what >> is >> > incorrect there. Therefore, please do the following: >> > >> > 1. open a Windows command shell (what you call a DOS window) >> > 2. type "echo %PATH%" >> > 3. Send us the output. >> > >> > Uwe Ligges >> > >> > >> > >> > On 08.01.2011 19:29, Aaditya Nanduri wrote: >> > >> >> Mr. Gregory : I may have to resort to a roundabout method like yours. I >> >> just >> >> cant seem to make it work. Thank you for your help. >> >> >> >> Mr. Spector : Everytime I change the path, I closed all the DOS >> windows. >> >> Yet, R is not recognized as a command. Also, I just want to say, you >> have >> >> an >> >> awesome last name. >> >> >> >> >> >> >> -- >> Aaditya Nanduri >> aaditya.nand...@gmail.com >> >>[[alternative HTML version deleted]] >> >> __ >> R-help@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. >> > > -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
Although it could easily be "user error", I never got Rpy or Rpy2 working an any sort of reliable way. However I did learn a couple of things about the Windows PATH First, (as others have mentioned) it's easiest to modify the PATH through the Windows GUI that comes up when you right click "My Computer", and then you can modify the "Environmental Variables" somewhere. Second, here are examples of the syntax for adding things to the PATH from a DOS command line path = %PATH%;C:\Program Files\R\R-2.12.1\bin path = %PATH%;C:\Rtools\bin path = %PATH%;C:\Rtools\MinGW\bin path = %PATH%;C:\Rtools\perl\bin set R_HOME = C:\Program Files\R\R-2.12.1\ Third, I found this R command useful for checking the path from within R: Sys.getenv()[['PATH']] On Wed, Jan 12, 2011 at 10:43 AM, Aaditya Nanduri wrote: > 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 > > 2011/1/8 Uwe Ligges > > > OK, then let's see if you managed to change the PATH or let is see what > is > > incorrect there. Therefore, please do the following: > > > > 1. open a Windows command shell (what you call a DOS window) > > 2. type "echo %PATH%" > > 3. Send us the output. > > > > Uwe Ligges > > > > > > > > On 08.01.2011 19:29, Aaditya Nanduri wrote: > > > >> Mr. Gregory : I may have to resort to a roundabout method like yours. I > >> just > >> cant seem to make it work. Thank you for your help. > >> > >> Mr. Spector : Everytime I change the path, I closed all the DOS windows. > >> Yet, R is not recognized as a command. Also, I just want to say, you > have > >> an > >> awesome last name. > >> > >> > > > -- > Aaditya Nanduri > aaditya.nand...@gmail.com > >[[alternative HTML version deleted]] > > __ > R-help@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. > [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
On 12.01.2011 18:13, Daniel Nordlund wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Aaditya Nanduri Sent: Wednesday, January 12, 2011 8:44 AM To: Uwe Ligges Cc: r-help@r-project.org; spec...@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\i386 Right, 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@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. __ R-help@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.
Re: [R] R not recognized in command line
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Aaditya Nanduri > Sent: Wednesday, January 12, 2011 8:44 AM > To: Uwe Ligges > Cc: r-help@r-project.org; spec...@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\i386 Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __ R-help@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.
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 2011/1/8 Uwe Ligges > OK, then let's see if you managed to change the PATH or let is see what is > incorrect there. Therefore, please do the following: > > 1. open a Windows command shell (what you call a DOS window) > 2. type "echo %PATH%" > 3. Send us the output. > > Uwe Ligges > > > > On 08.01.2011 19:29, Aaditya Nanduri wrote: > >> Mr. Gregory : I may have to resort to a roundabout method like yours. I >> just >> cant seem to make it work. Thank you for your help. >> >> Mr. Spector : Everytime I change the path, I closed all the DOS windows. >> Yet, R is not recognized as a command. Also, I just want to say, you have >> an >> awesome last name. >> >> -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
OK, then let's see if you managed to change the PATH or let is see what is incorrect there. Therefore, please do the following: 1. open a Windows command shell (what you call a DOS window) 2. type "echo %PATH%" 3. Send us the output. Uwe Ligges On 08.01.2011 19:29, Aaditya Nanduri wrote: Mr. Gregory : I may have to resort to a roundabout method like yours. I just cant seem to make it work. Thank you for your help. Mr. Spector : Everytime I change the path, I closed all the DOS windows. Yet, R is not recognized as a command. Also, I just want to say, you have an awesome last name. __ R-help@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.
Re: [R] R not recognized in command line
Mr. Gregory : I may have to resort to a roundabout method like yours. I just cant seem to make it work. Thank you for your help. Mr. Spector : Everytime I change the path, I closed all the DOS windows. Yet, R is not recognized as a command. Also, I just want to say, you have an awesome last name. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
Aaditya, I was also having some trouble using RPy2 (spoiler alert: I gave up!) to write a GUI for some R scripts I've written. I found a workaround to integrate R and python without using that module. The idea is: 1. Write R scripts you want to use in python. I have a file with all of the functions I'll need to use. 2. Write python code that writes R code (according to whatever inputs you want...) calling the functions in your script. For example, if the R function I wanted to use was "sum", I'd have users input two numbers in python, and have python create the string "sum(867, 5309)" 3. Open the file with the Rscript using python, and add "sum(867, 5309)" to the end of it. 4. Create the string t = "cd C:\Program Files\R\R-2.11.0\bin&Rscript sum.r" in python, where "sum.r" is a file with the "sum" function, to which we added the string "sum(867, 5309)" using python and "C:\...\bin" is whatever directory your R installation is in. 5. Finally, open the shell as a subprocess using python and send "t" to the shell. This method works if you don't need to see the output of the R script in the python console. If you really want to see that, have R write the output into some file that python can open and open that with python script! I did all this without any experience with python (I'm alright with R), so you may even find some shortcuts. Good Luck, Erik Gregory, Student Assistant, California EPA CSU Sacramento, Mathematics - Original Message From: Aaditya Nanduri To: Gabor Grothendieck Cc: r-help@r-project.org Sent: Thu, January 6, 2011 6:23:46 PM Subject: Re: [R] R not recognized in command line I really appreciate all your help but I've already tried everything that has been suggested. I changed the path to every possible combination that leads to an R executable...and nothing seems to work. I've checked to see that Im typing it right. I've also asked my sister to make sure (a fresh set of eyes is always helpful). The only thing that work are navigating to the folder holding the R executable (R_HOME/bin) and the batchscripts. However, this doesnt help me in working with rpy2. On Wed, Jan 5, 2011 at 9:59 AM, Gabor Grothendieck wrote: > On Wed, Jan 5, 2011 at 10:41 AM, Duncan Murdoch > wrote: > > On 11-01-05 8:51 AM, Joshua Wiley wrote: > >> > >> 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. > > > > Editing the PATH is probably the best approach, but a lot of people get > it > > wrong because of misunderstanding how it works: > > > > - If you change PATH in one process the changes won't propagate > anywhere > > else, and will be lost as soon as you close that process. That could be > a > > cmd window, or an R session, or just about any other process that lets > you > > change environment variables. > > > > - If you want to make global changes to the PATH, you need to do it in > the > > control panel "System|Advanced|Environment variables" entries. > > > > - Often it is good enough to use a more Unix-like approach, and only > make > > the change at startup of the cmd processor. You use the /k option when > > starting cmd if you want to run something on startup. > > > > You can also use Rcmd.bat, R.bat, Rgui.bat, etc. found at > http://batchfiles.googlecode.com > > Just put any you wish to use anywhere on your path and it will work on >
Re: [R] R not recognized in command line
I really appreciate all your help but I've already tried everything that has been suggested. I changed the path to every possible combination that leads to an R executable...and nothing seems to work. I've checked to see that Im typing it right. I've also asked my sister to make sure (a fresh set of eyes is always helpful). The only thing that work are navigating to the folder holding the R executable (R_HOME/bin) and the batchscripts. However, this doesnt help me in working with rpy2. On Wed, Jan 5, 2011 at 9:59 AM, Gabor Grothendieck wrote: > On Wed, Jan 5, 2011 at 10:41 AM, Duncan Murdoch > wrote: > > On 11-01-05 8:51 AM, Joshua Wiley wrote: > >> > >> 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. > > > > Editing the PATH is probably the best approach, but a lot of people get > it > > wrong because of misunderstanding how it works: > > > > - If you change PATH in one process the changes won't propagate > anywhere > > else, and will be lost as soon as you close that process. That could be > a > > cmd window, or an R session, or just about any other process that lets > you > > change environment variables. > > > > - If you want to make global changes to the PATH, you need to do it in > the > > control panel "System|Advanced|Environment variables" entries. > > > > - Often it is good enough to use a more Unix-like approach, and only > make > > the change at startup of the cmd processor. You use the /k option when > > starting cmd if you want to run something on startup. > > > > You can also use Rcmd.bat, R.bat, Rgui.bat, etc. found at > http://batchfiles.googlecode.com > > Just put any you wish to use anywhere on your path and it will work on > all cmd instances and will also work when you install a new version of > R since it looks up R's location in the registry. > > -- > Statistics & Software Consulting > GKX Group, GKX Associates Inc. > tel: 1-877-GKX-GROUP > email: ggrothendieck at gmail.com > > __ > R-help@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. > -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.
Re: [R] R not recognized in command line
On Wed, Jan 5, 2011 at 7:41 AM, Duncan Murdoch wrote: > Editing the PATH is probably the best approach, but a lot of people get it > wrong because of misunderstanding how it works: > > - If you change PATH in one process the changes won't propagate anywhere > else, and will be lost as soon as you close that process. That could be a > cmd window, or an R session, or just about any other process that lets you > change environment variables. > > - If you want to make global changes to the PATH, you need to do it in the > control panel "System|Advanced|Environment variables" entries. Note it is also possible to make global changes using the powershell by setting the user to "Machine". [Environment]::SetEnvironmentVariable("TestVariable", "Test value.", "Machine") Josh > > - Often it is good enough to use a more Unix-like approach, and only make > the change at startup of the cmd processor. You use the /k option when > starting cmd if you want to run something on startup. > > Duncan Murdoch __ R-help@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.
Re: [R] R not recognized in command line
On Wed, Jan 5, 2011 at 10:41 AM, Duncan Murdoch wrote: > On 11-01-05 8:51 AM, Joshua Wiley wrote: >> >> 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. > > Editing the PATH is probably the best approach, but a lot of people get it > wrong because of misunderstanding how it works: > > - If you change PATH in one process the changes won't propagate anywhere > else, and will be lost as soon as you close that process. That could be a > cmd window, or an R session, or just about any other process that lets you > change environment variables. > > - If you want to make global changes to the PATH, you need to do it in the > control panel "System|Advanced|Environment variables" entries. > > - Often it is good enough to use a more Unix-like approach, and only make > the change at startup of the cmd processor. You use the /k option when > starting cmd if you want to run something on startup. > You can also use Rcmd.bat, R.bat, Rgui.bat, etc. found at http://batchfiles.googlecode.com Just put any you wish to use anywhere on your path and it will work on all cmd instances and will also work when you install a new version of R since it looks up R's location in the registry. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com __ R-help@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.
Re: [R] R not recognized in command line
On 11-01-05 8:51 AM, Joshua Wiley wrote: 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. Editing the PATH is probably the best approach, but a lot of people get it wrong because of misunderstanding how it works: - If you change PATH in one process the changes won't propagate anywhere else, and will be lost as soon as you close that process. That could be a cmd window, or an R session, or just about any other process that lets you change environment variables. - If you want to make global changes to the PATH, you need to do it in the control panel "System|Advanced|Environment variables" entries. - Often it is good enough to use a more Unix-like approach, and only make the change at startup of the cmd processor. You use the /k option when starting cmd if you want to run something on startup. Duncan Murdoch Cheers, Josh On Tue, Jan 4, 2011 at 9:39 PM, Aaditya Nanduri 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.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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. __ R-help@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.
Re: [R] R not recognized in command line
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 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.nand...@gmail.com > > [[alternative HTML version deleted]] > > __ > R-help@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/ __ R-help@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.
[R] R not recognized in command line
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.nand...@gmail.com [[alternative HTML version deleted]] __ R-help@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.