virtualstaticvoid/heroku-buildpack-r — pull request #32 by craigschmidt (2014-02-12 22:09:51+00:00)
Title: change R_HOME to point to /app/vendor/R/lib64/R

Hi Chris,

I've been using your heroku-buildpack-r today, to try to get R running with python. I'm using the rpy2 library (http://rpy.sourceforge.net/rpy2.html) to call R code from python.

One problem that I've been having is the rpy2 looks at the R_HOME environment variable set in your code, but it is pointing at the wrong directory. I believe the R_HOME directory should be /app/vendor/R/lib64/R rather than /app/vendor/R. The rpy2 code looks for $R_HOME/etc/Renviron for example.

If you run your current code, you'll notice a warning that R is ignoring the value of R_HOME. You can also see from the R.home() function that R believes the directory is /app/vendor/R/lib64/R. So R is fine, but downstream code will be using the wrong directory.

I have changed the directories, creating a new variable R_BASE for /app/vendor/R, and computing the R_HOME off of that.

This is the first pull request I've ever done, so my apologies if I screw something up.

With the current code you get:

```bash
(django160)[cschmidt@egon:~/pa/test-just-r]$ heroku run R
```
```R
Running `R` attached to terminal... up, run.1562
WARNING: ignoring environment value of R_HOME

R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> R.home()
[1] "/app/vendor/R/lib64/R"
```
```bash
(django160)[cschmidt@egon:~/pa/test-just-r]$ heroku run bash
Running `bash` attached to terminal... up, run.1385
~ $ echo $R_HOME
/app/vendor/R
~ $ cd /app/vendor/R/lib64/R
~/vendor/R/lib64/R $ ls
bin doc etc include lib library modules share
```

Thanks,
Craig Schmidt