R - 如何为闪亮的服务器设置 install.packages() 的路径?- Ubuntu [英] R - How to set the path of install.packages() for shiny server ? - Ubuntu
问题描述
对于我的系统:Ubuntu 12.04 和 R 3.03,每当我通过
For my system: Ubuntu 12.04 and R 3.03, whenever I install a custom package in R via
>install.packages()
软件包默认安装到
/home/USER/R/x86_64-pc-linus-gnu-library/3.0/
相对于系统范围内
/usr/local/lib/R/site-library/
shiny-server 需要使用该软件包.
我的临时解决方案是事后将包复制到正确的文件夹中.
My temporary solution is to copy the packages to the correct folder after the fact.
问题:如何从一开始就设置默认安装路径以避免此问题?
推荐答案
是的 -- 我认为这是一个错误的功能并禁用了我的每个用户目录.
Yes -- I consider this to be a misfeature and disable my per-user directory.
此外,我主要使用脚本 install.r
(其中一个版本是您可以作为 Ubuntu 的一部分安装的较小软件包中的一个示例),它简单地显式设置 /usr/local/lib/R/site-library
目录为默认值.通过我们打入 R 3.0.2 或 3.0.3 的补丁,普通用户可以写入目录,现在将创建组可写目录,以便其他用户可以更新和覆盖——只要让每个人都成为同一组的成员,比如说staff
或 admin
.然后你甚至不需要 sudo
或 root.
Moreover, I mostly use a script install.r
(of which a version is an example in the littler package you can install as part of Ubuntu) which simple explicitly set the /usr/local/lib/R/site-library
directory as the default. With a patch we got into R 3.0.2 or 3.0.3, normal user can write into the directory and will now create group-writeable directories so other users can update and overwrite -- just make everybody a member of the same group, say staff
or admin
. And then you don't even need sudo
or root.
这些年来,我基本上已经在这里回答了几次相同的问题(减去闪亮的角度,这并不真正相关)所以请随意搜索另一个以获取更多详细信息、示例,...
I have essentially answered this same question a few times here over the years (minus the shiny angle, which is not really relevant) so feel free to search for the other for more details, examples, ...
这篇关于R - 如何为闪亮的服务器设置 install.packages() 的路径?- Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!