Package 'renvvv'

Title: Robust 'renv' Package Restore and Update Functions
Description: Provides more robust 'renv' restore and update functions that continue past individual package failures, retry them individually, and report what could not be installed. Unlike the standard 'renv::restore()', which stops on the first error, these functions allow the installation process to proceed for all packages that can be successfully restored.
Authors: Miguel Rodo [aut, cre] (ORCID: <https://orcid.org/0000-0002-2036-4878>)
Maintainer: Miguel Rodo <[email protected]>
License: MIT + file LICENSE
Version: 0.4.2
Built: 2026-06-04 17:53:34 UTC
Source: https://github.com/MiguelRodo/renvvv

Help Index


Install Packages Robustly

Description

A "tryhard" version of renv::install(). It first attempts to install all specified packages in a single vectorized call. If that fails, it compares the current installed packages and their versions against the state prior to the installation attempt. Any package that is still missing or whose version did not change will then be installed individually, ensuring that one failing package does not prevent the installation of others.

Usage

renvvv_install(packages, prompt = FALSE, args_install = list())

Arguments

packages

A character vector of packages to install. Can contain CRAN, Bioconductor, or GitHub package references (e.g., "dplyr", "user/repo@v1").

prompt

Logical. Whether to prompt for user confirmation during installation. Default is FALSE.

args_install

List. Arbitrary arguments to pass down to renv::install().

Value

Invisibly returns TRUE upon completion.

Examples

## Not run: 
# Install multiple packages robustly
renvvv_install(c("dplyr", "ggplot2", "SATVILab/projr@dev"))

# Pass arbitrary parameters down to renv::install
renvvv_install(c("dplyr"), args_install = list(rebuild = TRUE))

## End(Not run)

Restore renv Lockfile Packages

Description

Restores packages from the lockfile, attempting to install the lockfile versions. When individual packages fail, continues with the remaining packages and retries failures individually.

If an renv project is detected (via renv.lock file) but not currently active, the function will activate it. In interactive sessions, the user will be prompted for confirmation before activation. In non-interactive sessions, activation occurs automatically.

Usage

renvvv_restore(
  github = TRUE,
  non_github = TRUE,
  biocmanager_install = FALSE,
  skip = character(0),
  prompt = FALSE,
  transactional = FALSE,
  args_restore = list(),
  args_install = list()
)

Arguments

github

Logical. Whether to process GitHub packages. Default is TRUE.

non_github

Logical. Whether to process non-GitHub packages (CRAN and Bioconductor). Default is TRUE.

biocmanager_install

Logical. If TRUE, Bioconductor packages will be installed using BiocManager::install; otherwise, renv::install("bioc::<package_name>") will be used. Default is FALSE.

skip

Character vector. Package names to skip during restore. Default is character(0) (no packages skipped).

prompt

Logical. Whether to prompt for user confirmation during renv operations. Default is FALSE.

transactional

Logical. Whether to use transactional package restoration. Default is FALSE.

args_restore

List. Arbitrary arguments to pass down to renv::restore().

args_install

List. Arbitrary arguments to pass down to renv::install() when fallback installations occur.

Value

Invisibly returns TRUE upon successful completion.

Examples

## Not run: 
# Restore all packages
renvvv_restore()

# Only restore non-GitHub packages
renvvv_restore(github = FALSE)

# Pass clean = FALSE to renv::restore
renvvv_restore(args_restore = list(clean = FALSE))

## End(Not run)

Restore and Update renv Lockfile Packages

Description

First restores packages from the lockfile, then updates them to the latest versions. Combines renvvv_restore() and renvvv_update() in sequence.

If an renv project is detected (via renv.lock file) but not currently active, the function will activate it. In interactive sessions, the user will be prompted for confirmation before activation. In non-interactive sessions, activation occurs automatically.

Usage

renvvv_restore_and_update(
  github = TRUE,
  non_github = TRUE,
  biocmanager_install = FALSE,
  skip = character(0),
  skip_if_dep_unavailable = TRUE,
  prompt = FALSE,
  transactional = FALSE,
  args_restore = list(),
  args_update = list(),
  args_install = list()
)

Arguments

github

Logical. Whether to process GitHub packages. Default is TRUE.

non_github

Logical. Whether to process non-GitHub packages (CRAN and Bioconductor). Default is TRUE.

biocmanager_install

Logical. If TRUE, Bioconductor packages will be installed using BiocManager::install; otherwise, renv::install("bioc::<package_name>") will be used. Default is FALSE.

skip

Character vector. Package names to skip during restore and update. Default is character(0) (no packages skipped).

skip_if_dep_unavailable

Logical. Passed to renvvv_update(). If TRUE, skip installing a package during the update step when one of its lockfile-listed dependencies previously failed to install and is not currently available. Default is TRUE.

prompt

Logical. Whether to prompt for user confirmation during renv operations. Default is FALSE.

transactional

Logical. Whether to use transactional package restoration. Default is FALSE.

args_restore

List. Arbitrary arguments to pass down to renv::restore().

args_update

List. Arbitrary arguments to pass down for update operations.

args_install

List. Arbitrary arguments to pass down to renv::install().

Value

Invisibly returns TRUE upon successful completion.


Update renv Lockfile Packages

Description

Updates packages to their latest available versions, ignoring the lockfile versions. When individual packages fail, continues with the remaining packages and retries failures individually.

If an renv project is detected (via renv.lock file) but not currently active, the function will activate it. In interactive sessions, the user will be prompted for confirmation before activation. In non-interactive sessions, activation occurs automatically.

Usage

renvvv_update(
  github = TRUE,
  non_github = TRUE,
  biocmanager_install = FALSE,
  skip = character(0),
  skip_if_dep_unavailable = TRUE,
  prompt = FALSE,
  transactional = FALSE,
  args_update = list(),
  args_install = list()
)

Arguments

github

Logical. Whether to process GitHub packages. Default is TRUE.

non_github

Logical. Whether to process non-GitHub packages (CRAN and Bioconductor). Default is TRUE.

biocmanager_install

Logical. If TRUE, Bioconductor packages will be installed using BiocManager::install; otherwise, renv::install("bioc::<package_name>") will be used. Default is FALSE.

skip

Character vector. Package names to skip during update. Default is character(0) (no packages skipped).

skip_if_dep_unavailable

Logical. If TRUE, skip installing a package when one of its lockfile-listed dependencies previously failed to install and is not currently available. Default is TRUE.

prompt

Logical. Whether to prompt for user confirmation during renv operations. Default is FALSE.

transactional

Logical. Whether to use transactional package restoration. Default is FALSE.

args_update

List. Arbitrary arguments to pass down for update operations.

args_install

List. Arbitrary arguments to pass down to renv::install().

Value

Invisibly returns TRUE upon successful completion.