renv::checkout() can be used to install and use the latest packages
available from the requested repositories. This can be useful for cleaning
up a library which has become a mish-mash of packages installed from a
variety of disparate sources.
checkout(
repos = getOption("repos"),
...,
packages = NULL,
clean = FALSE,
project = NULL
)The R package repositories to check out.
Unused arguments, reserved for future expansion. If any arguments
are matched to ..., renv will signal an error.
The packages to be installed. When NULL (the default),
all packages currently used in the project will be installed.
Boolean; remove packages not recorded in the lockfile from
the target library? Use clean = TRUE if you'd like the library state
to exactly reflect the lockfile contents after restore().
The project directory. If NULL, then the active project will
be used. If no project is currently active, then the current working
directory is used instead.