How do I find the location of an R library on Mac OSX?

On linux, usually $HOME/R/... , where is it on a Mac?

I tried something like locate Rcpp , but did not get any useful information.

R is installed via homebrew, and the OSX version is 10.9 (mavericks).

+8
r macos
source share
3 answers

With .Library you will get your default location in the library
With .libPaths("your/path") you can also get / set library trees (see ?.libPaths )
and with getwd() respectively. setwd("your/path") you get / set your working directory

+17
source share

You can look at /Library/Frameworks/R.framework/Resources/library

+2
source share

You can use the find.package function to find paths to one or more packages.

Example (finding the path to the R rj library):

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

Alternatively, you can use packageDescription . For example:

 > 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 
0
source share

All Articles