This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
r_antsr_usage [2016/03/23 21:06] mgstauff |
r_antsr_usage [2017/04/10 20:28] (current) mgstauff [Local/User Package Installation] |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== R ===== | ===== R ===== | ||
+ | |||
+ | ==== Local/User Package Installation ==== | ||
+ | |||
+ | As of R 3.2, R should create a default location for local libraries (i.e. that you install on your own). Check using the '' | ||
+ | |||
+ | R_LIBS_USER will by default be the first line shown by '' | ||
+ | |||
+ | **HOWEVER** if you define R_LIBS, it will be used before R_LIBS_USER in search and installation paths. This can be confusing. For installation, | ||
+ | |||
+ | Some documentation here: | ||
+ | https:// | ||
+ | |||
+ | |||
+ | ==== Managing Packages ==== | ||
+ | |||
+ | Managing packages: | ||
+ | |||
+ | R can read packages from any of the locations listed in .libPaths(). This typically contains both a system directory (under / | ||
+ | |||
+ | To avoid this, use the packrat package (https:// | ||
+ | |||
+ | Packages that don't affect the outcome of studies, like roxygen2 or ggplot2, can be defined as " | ||
==== '' | ==== '' | ||
Line 22: | Line 44: | ||
==== Installing from R ==== | ==== Installing from R ==== | ||
- | (Thanks to Phil Cook!) | + | (Thanks to Phil Cook! Updated 4/2017) |
Setup in your '' | Setup in your '' | ||
- | export PATH=/ | + | export PATH=/ |
| | ||
- | export R_LIBS=/ | ||
- | |||
Then on chead | Then on chead | ||
Line 36: | Line 56: | ||
> install.packages(" | > install.packages(" | ||
> library(devtools) | > library(devtools) | ||
- | > install_github(" | ||
> install_github(" | > install_github(" | ||
+ | > install_github(" | ||
> install_github(" | > install_github(" | ||
+ | | ||
+ | |||
+ |