Skip to content

Commit

Permalink
add back library path documentation (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Nov 7, 2023
1 parent 287cd68 commit 70ba9e2
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions vignettes/packages.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,43 @@ requested package. See the remotes vignette,
for more details.


## Library Paths

For package projects using renv, a library path outside of the project
directory will be used instead. As an example, on macOS, this might look like:

```
> .libPaths()
[1] "/Users/kevin/Library/Caches/org.R-project.R/R/renv/library/example-552f6e80/R-4.3/aarch64-apple-darwin20"
[2] "/Users/kevin/Library/Caches/org.R-project.R/R/renv/sandbox/R-4.3/aarch64-apple-darwin20/ac5c2659"
```

This is done to avoid issues with `R CMD build`, which can become very slow if
your project contains a large number of files -- as can happen with the project`
library in the default location of `renv/library`. Note that even though the
library is located outside of the project, the library path generated will still
be unique to that project, and so the project is still effectively isolated in
the same way as other renv projects normally are.

If you want to customize the location where `renv` places project libraries in
this scenario, you can use the `RENV_PATHS_LIBRARY_ROOT` environment variable.
For example:

```
RENV_PATHS_LIBRARY_ROOT = ~/.renv/library
```

If you'd still prefer to keep your project library within the project directory,
you can set:

```
RENV_PATHS_LIBRARY = renv/library
```

within an appropriate `.Renviron` start-up profile -- but please be aware of
the caveats to doing this, as the performance of `R CMD build` will be affected.


## Testing

While developing your package, you may want to use a continuous integration
Expand Down

0 comments on commit 70ba9e2

Please sign in to comment.