rpy2 ignores settings in /etc/R/Renvison.site, etc.

Issue #81 resolved
Christian Hudon created an issue

Code that was working under R wouldn't work under rpy2. I figured out that rpy2 was ignoring /etc/R/Renviron.site by default. (I was adding to R_LIBS, etc.) This is because rpy2 initializes R using its --vanilla option.

In my opinion, this choice of default does not follow the principle of least surprise. And ignoring /etc/R/Renviron.site (which is the file where the sysadmin can make local additions to R_LIBS, etc.) is not very convenient.

I'm proposing this patch, which removes the --vanilla from the default arguments passed to R, and add the --no-restore option (which was included in --vanilla and not part of the other options passed to R by rpy2). Please consider this patch for inclusion in the next release of rpy2. Thanks.

Comments (2)

  1. Laurent Gautier

    Yes, the question was asked a short time ago: http://stackoverflow.com/questions/6364082/rpy2-importr-fails-with-renviron

    ...and I am tempted to write "was only asked a short time ago", as this could go without being noticed for quite some time.

    The choice to have this "feature" was made consciously and the rationale at the was there were plenty of ways to get into trouble with rpy2 and I should the case where people had a mix-up of R versions rpy2 was compiled against topped by R_LIBS do not know/remember about out of the way; if people purposedly set R_LIBS and met issues, they would know how to either figure it out itself or mail constructively about the issue. Documenting this fell between the cracks.

    I am divided about what to make the default, but I guess that not a big thing care was taken to let one set it to his/her liking fairly effortlessly.

  2. Log in to comment