Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find out R library location in Mac OSX?

Tags:

macos

r

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

I tried something like locate Rcpp, but didn't get any useful info.

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

like image 366
qed Avatar asked Jul 22 '14 06:07

qed


2 Answers

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

like image 178
Rentrop Avatar answered Oct 18 '22 10:10

Rentrop


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

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

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

Alternatively you may 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 <[email protected]>
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 
like image 44
Franck Dernoncourt Avatar answered Oct 18 '22 10:10

Franck Dernoncourt