Question

Error: Tried to guess R's HOME but no R command in the PATH.

I did exactly this:

3. Define environmental variables

Control Panel | Advanced tab | Environmental Variables

define the following: RHOME, R_HOME, R_USER

examples

`RHOME: C:\Program Files\R\R-2.13.1
+R_HOME: C:\Program Files\R\R-2.13.1
+R_USER: C:\Users\username\Documents`

4. Append path to R (and Rtools) executable(s) to PATH

Control Panel | Advanced tab | Environmental Variables

example paths: C:\Program Files\R\R-2.13.1\bin\i386; C:\Rtools\bin

However, I do not undestand point three exactly. Could you explain the meaning behind RHOME, R_HOME, R_USER? Thank you, it is really urgent!

Was it helpful?

Solution

You might find it a lot easier to grab the binary installer from the repository at the University of California at Irvine.

Test with this:

import rpy2.robjects as robjects
print robjects.r('pi')

Other things to look at:

  • In Windows, when you set an environment variable via the control panel, you'll have to restart the command shell for it to be accepted.
  • R_HOME points to the R distribution. R_USER is where you would store local files. Ideally, if you set these as user variables, your path can then reference %R_HOME% instead o the hard-coded path. There is more information on Windows' handling of the two kinds of environment variables here.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top