安装适用于所有用户的 R 包 [英] Installing R packages available for all users

查看:23
本文介绍了安装适用于所有用户的 R 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ~/R/i486-pc-linux-gnu-library/2.11 下安装了一些 R 包.

I have a few R packages installed under ~/R/i486-pc-linux-gnu-library/2.11.

我想让它们以及我从现在开始安装的任何其他 R 包都可供所有 R 用户使用.我不介意在中立的地方重新安装我已经拥有的软件包(它们只是几个).那我该怎么做呢?

I would like to make them, and any other R package I install from now on, available to all R users. I don't mind re-installing the packages I already have in a neutral place (they are just a few). So how do I do that?

推荐答案

aL3xa 给出了(恕我直言)不好的建议.不要乱用包管理系统处理的/usr.相反,请使用 /usr/local/lib/R/site-library 提供的工具.

aL3xa gives (IMHO) bad advice. Do not mess with /usr which is handled by the package management system. Instead, use the facility provided by /usr/local/lib/R/site-library.

默认情况下已经搜索了后一个目录.您需要做的就是将自己添加到组 staff 中,因为该组在那里具有写权限 - 尝试 adduser yourid staff 其中 yourid 是您在系统上的用户名.之后你应该可以毫无问题地在那里安装.

That latter directory is already searched by default. All you need to do is to add yourself to group staff as that group has write-rights there -- try adduser yourid staff where yourid is your user name on the system. Afterwards you should be able to install there without problems.

在 Ubuntu 上您可能喜欢的另一件事是 apt-get install littler,然后使用 install.rupgrade.r 辅助脚本从示例目录.我一直在使用它们.

Another thing you may like on Ubuntu is apt-get install littler and then use the install.r and upgrade.r helper scripts from the examples directory. I use them all the time.

这篇关于安装适用于所有用户的 R 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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