如何确保同一服务器上不同用户之间的R环境一致? [英] How can I ensure a consistent R environment among different users on the same server?

查看:103
本文介绍了如何确保同一服务器上不同用户之间的R环境一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用内部程序包"MyPKG"编写用于可重复分析的方案.每个用户将提供他们自己的输入文件;除输入外,分析应在相同条件下进行. (例如,以便我们可以推断出不同的结果归因于不同的输入文件).

I am writing a protocol for a reproducible analysis using an in-house package "MyPKG". Each user will supply their own input files; other than the inputs, the analyses should be run under the same conditions. (e.g. so that we can infer that different results are due to different input files).

MyPKG正在开发中,因此library(MyPKG)将加载用户在其本地库中编译的最后一个版本.它还将加载在其本地库中找到的所有依赖项.

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

但是我希望每个人都使用特定版本(MyPKG_3.14)进行此分析,同时仍然允许开发更新的版本.如果我理解正确,"R --vanilla"将为每个人加载相同的依赖项.

But I want everyone to use a specific version (MyPKG_3.14) for this analysis while still allowing development of more recent versions. If I understand correctly, "R --vanilla" will load the same dependencies for everyone.

完成后,我们会将工作环境另存为VM,以维护稳定的可复制环境.因此,临时的(6个月)解决方案就足够了.

Once we are done, we will save the working environment as a VM to maintain a stable reproducible environment. So a temporary (6 month) solution will suffice.

我想出了两种可能的解决方案,但不确定是否足够.

I have come up with two potential solutions, but am not sure if either is sufficient.

  1. 请服务器管理员将MyPKG_3.14安装到默认R路径中,然后在协议中提供以下代码:

  1. ask the server admin to install MyPKG_3.14 into the default R path and then provide the following code in the protocol:

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

在特定库中编译MyPKG_3.14,例如lib.loc ="/home/share/lib/R/MyPKG_3.14",然后提供

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

R --vanilla
library(MyPKG)


  • 这两种方法是否足以确保每个人都运行相同的版本?
  • 一个比另一个更好吗?
  • 还会出现其他无法预见的问题吗?
  • 是否存在用于标准化多个分析的首选方法?
  • 我应该对SessionInfo()的输出进行测试吗?
  • 在服务器上创建一个供所有人使用的帐户会更好吗?

    • Are both of these approaches sufficient to ensure that everyone is running the same version?
    • Is one preferable to the other?
    • Are there other unforseen issues that may arise?
    • Is there a preferred option for standardising the multiple analyses?
    • Should I include a test of the output of SessionInfo()?
    • Would it be better to create a single account on the server for everyone to use?
    • 推荐答案

      点对:

      • 使用系统范围的软件包安装,例如R的Debian/Ubuntu二进制文件(包括CRAN端口)将尝试使用/usr/local/lib/R/site-library(如果将其添加到拥有该目录的组中,则用户也可以安装).这样,每个人都会得到相同的版本
      • 使用系统范围的配置,例如比~/下的点文件更喜欢$R_HOME/etc/.出于同样的原因,Debian/Ubuntu软件包在/etc/R/
      • 中提供了软链接.
      • 使用R的工具查询其软件包(例如installed.packages())以报告软件包和版本.
      • 在可用的情况下使用操作系统级别的工具来查询操作系统的版本和版本.但是,这标准化程度较低.
      • Use system-wide installations of packages, e.g. the Debian / Ubuntu binary for R (incl the CRAN ports) will try to use /usr/local/lib/R/site-library (which users can install too if added to group owning the directory). That way everybody gets the same version
      • Use system-wide configuration, e.g. prefer $R_HOME/etc/ over the dotfiles below ~/. For the same reason, the Debian / Ubuntu package offers softlinks in /etc/R/
      • Use R's facilties to query its packages (eg installed.packages()) to report packages and versions.
      • Use, where available, OS-level facilities to query OS release and version. This, however, is less standardized.

      关于我在家里的盒子说的最后一点

      Regarding the last point my box 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:~$ 
      

      这是一个开始.

      这篇关于如何确保同一服务器上不同用户之间的R环境一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆