needsPackages: Check for and optionally install packages used by document.

View source: R/needsPackages.R

needsPackagesR Documentation

Check for and optionally install packages used by document.

Description

This function checks for needed packages

Usage

needsPackages(pkgs, install = TRUE, 
                    update = FALSE, 
                    load = FALSE, 
                    attach = FALSE)

Arguments

pkgs

A list of names of packages to check.

install

Whether to install missing packages.

update

Whether to update all packages that can be updated.

load

Whether to load namespaces for packages.

attach

Whether to run library calls.

Details

Each of the boolean arguments can be a vector of the same length as pkgs, applying separately to each entry.

Value

Called for the side effects.

Examples

# This shouldn't do anything, as patchDVI must already be
# installed!
needsPackages("patchDVI")

patchDVI documentation built on March 31, 2023, 11:34 p.m.