-
Notifications
You must be signed in to change notification settings - Fork 1.9k
initial scaffolding for renv cheat sheet #589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| - `renv::install()`: Install R packages. | ||
| - `renv::update()`: Update installed packages to their latest-available version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or perhaps these should be in a separate section -- I'm not totally sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?