initial scaffolding for renv cheat sheet#589
Conversation
| - `renv::install()`: Install R packages. | ||
| - `renv::update()`: Update installed packages to their latest-available version. |
There was a problem hiding this comment.
Or perhaps these should be in a separate section -- I'm not totally sure?
There was a problem hiding this comment.
would be great to clarify overlapping vs not functionality of renv::update() and renv::install()
shannonpileggi
left a comment
There was a problem hiding this comment.
thank you for getting this started, this is going to be a great resource!!
| - `renv::install()`: Install R packages. | ||
| - `renv::update()`: Update installed packages to their latest-available version. |
There was a problem hiding this comment.
would be great to clarify overlapping vs not functionality of renv::update() and renv::install()
| - implicit => scan R files for dependencies; e.g. called to library(dplyr) | ||
| - explicit => only scan project DESCRIPTION file; user must keep up-to-date | ||
| - Mention that `renv::install()` supports custom remotes, e.g. `renv::install("rstudio/dplyr")`? | ||
| - Mention `options(renv.config.pak.enabled = TRUE)` for pak integration? |
There was a problem hiding this comment.
is this robust enough for inclusion?
| - Discuss `renv::run()`? (Run an R script in the context of an `renv` project) | ||
| - Discuss `renv::checkout()`? (Install packages from a snapshot of Posit Package Manager) | ||
| - Discuss `renv::embed()` and `renv::use()`? (Ways to declare package dependency versions directly in .R / .Rmd / .qmd files) | ||
| - Worth discussing that `renv` infers a package's source from its DESCRIPTION file? And so requires the installer of that package (renv, pak, remotes) to encode Remote dependency information at installation time. |
There was a problem hiding this comment.
This is very helpful context; I'm unsure if this is better suited for cheatsheet or website documentation.
| ## Configuring renv | ||
|
|
||
| - `?renv::config`: User-specific settings. Tweak how you'd like `renv` to behave in different scenarios. | ||
| - `?renv::settings`: Project-level settings. These settings are persisted as part of the project, and will be active for any other collaborators in the project. |
There was a problem hiding this comment.
would be great to also have an example of setting specifications in an argument, i.e., renv::init(..., settings = X) to init with an explicit snapshot type
| - Discuss `renv::embed()` and `renv::use()`? (Ways to declare package dependency versions directly in .R / .Rmd / .qmd files) | ||
| - Worth discussing that `renv` infers a package's source from its DESCRIPTION file? And so requires the installer of that package (renv, pak, remotes) to encode Remote dependency information at installation time. | ||
| - Mention that more documentation + advanced topics are described in pkgdown website at https://rstudio.github.io/renv/index.html | ||
| ``` |
There was a problem hiding this comment.
other functions worth considering: renv::upgrade() ; renv::purge()/renv::remove() ; renv::record()
This gives some scaffolding for an
renvcheat sheet, alongside some of the topics that I think are worth highlighting therein.I included a "core concepts" section just because I think most new users of
renvhaven't thought much about where R packages actually get installed and loaded, but it might be too much?