0

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!

user21988
  • 67
  • 1
  • 9

1 Answers1

0

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.
Community
  • 1
  • 1
jim_carson
  • 368
  • 3
  • 8
  • Wow man! Thank you for your comment! I think it works now but I still receive this error message: import rpy2.robjects as robjects print robjects.r('pi') Unable to unlink tempfile c:\users\X\appdata\local\temp\tmpiqhlbp [1] 3.141593 – user21988 Jun 12 '13 at 14:48