Learn R Programming

usethis (version 1.5.0)

use_package: Depend on another package

Description

use_package() adds a CRAN package dependency to DESCRIPTION and offers a little advice about how to best use it. use_dev_package() adds a versioned dependency on an in-development GitHub package, adding the repo to Remotes so it will be automatically installed from the correct location.

Usage

use_package(package, type = "Imports", min_version = NULL)

use_dev_package(package, type = "Imports")

Arguments

package

Name of package to depend on.

type

Type of dependency: must be one of "Imports", "Depends", "Suggests", "Enhances", or "LinkingTo" (or unique abbreviation). Matching is case insensitive.

min_version

Optionally, supply a minimum version for the package. Set to TRUE to use the currently installed version.

See Also

The dependencies section of R Packages.

Examples

Run this code
# NOT RUN {
use_package("ggplot2")
use_package("dplyr", "suggests")
use_dev_package("glue")
# }

Run the code above in your browser using DataLab