Check whether a package is installed. If not, the procedure offers to install the latest version from CRAN or GitHub. Then it check for a minimum version.

require_package(pkg, version, repo = "CRAN")

Arguments

pkg

A string with the required package

version

A string with the minimum version, e.g. "0.1.0"

repo

A string with the GitHub repo name. For the default `repo == "CRAN"` installation proceeds from CRAN.

Value

A logical indicating success (TRUE) or failure (FALSE) for version check.