suggested: Import a package as a Suggests dependency

View source: R/suggested.R

suggestedR Documentation

Import a package as a Suggests dependency

Description

Creates an object in the current environment with the same name as the package, which can be used just like a package to access its namespace, throwing an error if the package is not installed.

Usage

suggested(
  pkgname,
  pkgversion = "",
  unavailable_callback = suggested_callback_error,
  env = parent.frame()
)

Arguments

pkgname

A character package name to import as a "Suggests" dependency

pkgversion

A character vector of package version specifications, as they would be specified in DESCRIPTION (for example, ">= 1.2.3").

unavailable_callback

A function to be called when the suggested package is meant to be used, but unavailable.

env

A environment in which the suggested package object should be assigned. By default, an object of the same name as the package is created in the parent environment.


dgkf/devutils documentation built on Jan. 3, 2023, 7:26 a.m.