使 R 安装独立/独立于用户 [英] Making R installation self-contained/user-independent
本文介绍了使 R 安装独立/独立于用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图让 R 忽略 c:\users\name\documents 并完全独立/便携
I'm trying to get R to ignore c:\users\name\documents and be completely self-contained/portable
这是我的目录结构:
.../R/R-2.1.2.2/...
.../R/r_user/
.../R/libs_site/
我更新了我的 Rprofile.site 如下:
I updated my Rprofile.site as follows:
# Set the working directory
setwd( file.path( R.home() , ".." , "r_user" ) )
# set the home directory
Sys.setenv(HOME=file.path( R.home() , ".." , "r_user" ) )
# Set the site library folder
.Library.site = file.path( R.home() , ".." , "libs_site" )
当 R 启动时,我运行 .libPaths() 但我仍然看到 c:/users/...
when R launches, I run .libPaths() but I still see c:/users/...
那么 R 可能没有按照上面的 Sys.setenv 进行更新?解决方案?
So perhaps R isn't updating per the Sys.setenv above? Solutions?
推荐答案
添加这个就行了:
.Library.site = file.path( R.home() , ".." , "site-library" )
.libPaths(.Library.site)
这篇关于使 R 安装独立/独立于用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文