gpt4 book ai didi

r - 设置 R_LIBS 并避免 "Would you like to use a personal library instead?"

转载 作者:行者123 更新时间:2023-12-04 09:35:32 25 4
gpt4 key购买 nike

我的个人库在 ~/.Renviron 中设置为 R_LIBS=~/.R/lib。当我从 rstudio 安装软件包时,这非常有效。当我尝试从普通的 R 控制台 session 安装新软件包时,它总是问我:

Would you like to use a personal library instead?  (y/n) y
Would you like to create a personal library
~/R/x86_64-redhat-linux-gnu-library/3.1
to install packages into? (y/n) n

当我从控制台 session 进行更新时, ~/.R/lib 中的现有包(以前从 rstudio 安装)更新没有问题。如果/usr 中有全局包也需要更新,R 再次询问我是否要创建 ~/R/x86_64-redhat-linux-gnu-library/3.1。

我已经尝试了多种配置,但没有找到解决方法。

专业提示?

最佳答案

是的,我总是在我使用的系统上取消它,我什至试图将它排除在我维护的 Debian 软件包之外。在 Debian 中,我们使用

/usr/lib/R/library                   for core R packages shipping with R
/usr/lib/R/site-library for r-cran-* packages from the distro
/usr/local/lib/R/site-library for what the user installs from CRAN

以适当的顺序:
R> .libPaths()
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" \
"/usr/lib/R/library"
R>

我通过评论这个来做到这一点
#R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.1'}
#R_LIBS_USER=${R_LIBS_USER-'~/Library/R/3.1/library'}

# edd Apr 2003 Allow local install in /usr/local, also add a directory for
# Debian packaged CRAN packages, and finally the default dir
# edd Jul 2007 Now use R_LIBS_SITE, not R_LIBS
R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:\
/usr/lib/R/site-library:/usr/lib/R/library'}

我想我必须在 Debian 包中更新我的补丁......

关于r - 设置 R_LIBS 并避免 "Would you like to use a personal library instead?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29969838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com