Skip to content

initial scaffolding for renv cheat sheet#589

Open
kevinushey wants to merge 1 commit into
rstudio:mainfrom
kevinushey:renv
Open

initial scaffolding for renv cheat sheet#589
kevinushey wants to merge 1 commit into
rstudio:mainfrom
kevinushey:renv

Conversation

@kevinushey

Copy link
Copy Markdown

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 thread html/renv.qmd
Comment on lines +68 to +69
- `renv::install()`: Install R packages.
- `renv::update()`: Update installed packages to their latest-available version.

Copy link
Copy Markdown
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?

Copy link
Copy Markdown

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 shannonpileggi left a comment

Copy link
Copy Markdown

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 thread html/renv.qmd
Comment on lines +68 to +69
- `renv::install()`: Install R packages.
- `renv::update()`: Update installed packages to their latest-available version.

Copy link
Copy Markdown

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

Comment thread html/renv.qmd
- 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?

Copy link
Copy Markdown

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?

Comment thread html/renv.qmd
- 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.

Copy link
Copy Markdown

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.

Comment thread html/renv.qmd
## 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.

Copy link
Copy Markdown

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

Comment thread html/renv.qmd
- 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
```

Copy link
Copy Markdown

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