Skip to content

Conversation

@kevinushey
Copy link

This gives some scaffolding for an renv cheat 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 renv haven't thought much about where R packages actually get installed and loaded, but it might be too much?

Comment on lines +68 to +69
- `renv::install()`: Install R packages.
- `renv::update()`: Update installed packages to their latest-available version.
Copy link
Author

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?

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()

Copy link

@shannonpileggi shannonpileggi left a 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!!

Comment on lines +68 to +69
- `renv::install()`: Install R packages.
- `renv::update()`: Update installed packages to their latest-available version.

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?

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.

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.

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
```

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants