title: How to set the R_HOME environment variable to the R home directory?
body: <p>I am trying to import rpy2 into python and I am getting this error:</p>
  
  <pre><code>RuntimeError: The R home directory could not be determined.
  Try to install R &lt;https://www.r-project.org/&gt;,
  set the R_HOME environment variable to the R home directory, or
  add the directory of the R interpreter to the PATH environment variable.
  </code></pre>
  
  <p>I am completely lost here as I have no idea what this is telling me. I tried to search up how to set the environment variable and couldn't find anything detailed enough that was helpful for me. I would appreciate it if the answer could be very straightforward as I am just a newbie. I am running OSX 10.11. </p>
  
  <p>Thank you (my first post, I apologize if I overlooked any rules in posting)</p>