Skip to contents

Assembles a prose text containing the reason why a certain R package is required by the fn of another pkg. Intended to be used as argument reason of rlang::check_installed().

Usage

reason_pkg_required(
  fn = rlang::call_name(rlang::caller_call()),
  pkg = utils::packageName(parent.frame())
)

Arguments

fn

Name of the function that requires the R package. A character scalar.

pkg

Name of the package fn is part of. A character scalar.

Value

A character scalar.

Examples

if (FALSE) { # \dontrun{
  rlang::check_installed(pkg = "foo",
                         reason = pal::reason_pkg_required(pkg = "bar",
                                                           fn = "serve"))
} # }