R在哪里存储软件包? [英] Where does R store packages?

查看:121
本文介绍了R在哪里存储软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R中的install.packages()函数是自动解压缩实用程序,可在R中获取并安装软件包.

The install.packages() function in R is the automatic unzipping utility that gets and install packages in R.

  1. 我如何找出R选择存储软件包的目录?

  1. How do I find out what directory R has chosen to store packages?

如何更改R存储和访问软件包的目录?

How can I change the directory in which R stores and accesses packages?

推荐答案

install.packages命令通过.libPaths变量进行查找.这是我在OSX上的默认设置:

The install.packages command looks through the .libPaths variable. Here's what mine defaults to on OSX:

> .libPaths()
[1] "/Library/Frameworks/R.framework/Resources/library"

默认情况下,我不在那里安装软件包,我更喜欢将它们安装在主目录中.在我的.Rprofile中,有以下一行:

I don't install packages there by default, I prefer to have them installed in my home directory. In my .Rprofile, I have this line:

.libPaths( "/Users/tex/lib/R" )

这会将目录"/Users/tex/lib/R"添加到.libPaths变量的前面.

This adds the directory "/Users/tex/lib/R" to the front of the .libPaths variable.

这篇关于R在哪里存储软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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