pkgr as a development tool


pkgr can be paired with renv to provide an isolated development environment to give significant control over the package versions being installed onto the system.

To allow pkgr to know what to do when using renv, you can set the configuration:

Lockfile:
  Type: renv

This will cause pkgr to install packages to the same place renv would also have normally done so (this is a platform dependent path that changes across operating systems, which is why it can't be a static value).

In addition, pkgr can understand dependencies specified in DESCRIPTION files if you are developing packages, using the Descriptions array just like you specify packages. You provide the path to the DESCRIPTION file relative to the pkgr.yml

For example, given a pkgr.yml at the root of an R package project, you could use the following:

Descriptions:
- DESCRIPTION

A complete example:

Version: 1
Descriptions:
- DESCRIPTION

Packages:
- devtools
- renv
- styler
- usethis
- pkgdown

Repos:
  - CRAN: https://cran.rstudio.com

Lockfile:
  Type: renv