How can I provide a consistent R environment among different users on the same server?

I am writing a protocol for reproducible analysis using my own MyPKG package. Each user will provide their own input files; besides inputs, analysis should be performed under the same conditions. (for example, so that we can conclude that different results are associated with different input files).

MyPKG is under development, so the library(MyPKG) download the one that was the last version that the user compiled in his local library. It will also download any dependencies found in their local libraries.

But I want everyone to use a specific version (MyPKG_3.14) for this analysis, while maintaining the possibility of developing later versions. If I understood correctly, "R-vanilla" will load the same dependencies for everyone.

As soon as we finish, we will save the working environment as a virtual machine in order to maintain a stable reproducible environment. Thus, a temporary (6-month) solution will be required.

I came up with two possible solutions, but I'm not sure that they are enough.

  • ask the server administrator to set MyPKG_3.14 to the default R path and then provide the following code in the protocol:

     R --vanilla library(MyPKG) .... 

    or

  • compile MyPKG_3.14 in a specific library, for example. lib.loc = "/home/share/lib/R/MyPKG_3.14" and then provide

     R --vanilla library(MyPKG) 

  • Are both of these approaches sufficient to ensure that everyone works in the same version?
  • Is another preferable?
  • Are there any other unforeseen problems that may arise?
  • Is there a preferred option for standardizing multiple analyzes?
  • Should I include SessionInfo() output SessionInfo() ?
  • Would it be better to create a single server account for all users?
+5
source share
1 answer

A couple of points:

  • Use system-wide package installations, for example. the Debian / Ubuntu binary for R (including CRAN ports) will try to use /usr/local/lib/R/site-library (which can also be installed when added to a group that owns a directory). This way everyone gets the same version.
  • Use a system-wide configuration, for example. prefer $R_HOME/etc/ over dotfiles below ~/ . For the same reason, the Debian / Ubuntu package offers programmatic links in /etc/R/
  • Use R facilties to request your packages (e.g. installed.packages() ) to send packages and versions.
  • Use, where available, OS-level tools to request release and OS version. This, however, is less standardized.

Regarding the last point, my boxing at home says

 > edd@max :~$ lsb_release -a | tail -4 > Distributor ID: Ubuntu > Description: Ubuntu 12.04.1 LTS > Release: 12.04 > Codename: precise > edd@max :~$ 

which is the beginning.

+1
source

All Articles