Skip to contents

Check if a package is already installed, if not then install it

Usage

installPackageIfNeeded(
  packageToInstallName,
  doUpdate,
  repo = "https://cloud.r-project.org",
  useCiOptions = 1
)

Arguments

packageToInstallName

Name of the package to install

doUpdate

1 to force re-installation other values to install only if not already installed

repo

The repository used to download packages

useCiOptions

1 (default) to use CI options as defined in optionsForCi.R, other values to not use them

Examples

if (FALSE) {
    citoolsr::installPackageIfNeeded(packageToInstallName = "stringi", doUpdate = 0)
}