如何在Mac OSX中找到R库位置?

时间:2014-07-22 06:40:15

标签: r macos

在Linux上,它通常是$HOME/R/...,它在Mac上的哪个位置?

我尝试了类似locate Rcpp的内容,但没有获得任何有用的信息。

R通过自制软件安装,OSX版本为10.9(小牛)。

3 个答案:

答案 0 :(得分:26)

使用.Library,您可以获得默认的库位置
使用.libPaths("your/path"),您还可以获取/设置库树(请参阅?.libPaths
getwd() resp。 setwd("your/path")您获取/设置工作目录

答案 1 :(得分:4)

您可以使用函数find.package查找一个或多个包的路径。

示例(查找R库rj的路径):

> find.package('rj')
[1] "\\\\nas/users/dernoncourt/Documents/dernoncourt/R/win-library/3.4/rj"

或者您可以使用packageDescription。例如:

> packageDescription("rj")
Encoding: UTF-8
Package: rj
Version: 2.1.0-13
Title: RJ - R Package for high-level Java-R library RJ
Author: Stephan Wahlbrink, Tobias Verbeke, low-level R binding based on the JRI library by Simon Urbanek
Maintainer: Stephan Wahlbrink <stephan.wahlbrink@walware.de>
Depends: R (>= 2.11.0)
Suggests: rj.gd
SystemRequirements: java
Description: Server implementation and R functions for the high-level Java-R library RJ.  The package also includes callback functions for StatET.  It is shipped with an adapted version of the JRI library.  The package can be used only when R was loaded via RJ.
License: LGPL (== 2.1)
URL: http://www.walware.de/goto/opensource
NeedsCompilation: yes
Packaged: 2017-05-10 08:22:44 UTC; build
Built: R 3.4.0; x86_64-w64-mingw32; 2017-05-10 08:25:27 UTC; windows

-- File: \\nas/users/dernoncourt/Documents/dernoncourt/R/win-library/3.4/rj/Meta/package.rds 

答案 2 :(得分:3)

你能看一下/Library/Frameworks/R.framework/Resources/library

吗?