R packages may have various types of dependencies, see Writing R Extensions.
r pak_or_pkgdepends()
groups dependencies into three groups:
r cli::format_inline("{.str {pkg_dep_types_hard()}}")
,r cli::format_inline("{.str {pkg_dep_types_soft()}}")
,r pak_or_pkgdepends()
supports concise ways of specifying which types of
dependencies of a package should be installed.
It is similar to how [utils::install.packages()] interprets its
dependencies
argument.
You typically use one of these values:
- NA
or "hard"
to install a package and its required dependencies,
- TRUE
to install all required dependencies, plus optional and development
dependencies.
If you need more flexibility, the full description of possible values for
the r if (is_pak()) "\\code{dependencies}" else "\\code{deps}"
argument are:
TRUE
: This means all hard dependencies plus Suggests
for
direct installations, and hard dependencies only for dependent
packages.FALSE
: no dependencies are installed at all.NA
(any atomic type, so NA_character_
, etc. as well): only hard
dependencies are installed.
r if (!is_pak()) "See [pkg_dep_types_hard()]."
direct
and indirect
, it is taken
as the requested dependency types, for direct installations and
dependent packages.If "hard"
is included in the value or a list element, then it is replaced
by the hard dependency types.
If "soft"
or "all"
is included, then it is replaced by all
hard and soft dependency.
r pak_or_pkgdepends()
supports extra dependency types for direct
installations not from CRAN-like repositories.
These are specified with a Config/Needs/
prefix in the DESCRIPTION
and they can contain package references, separated by commas.
For example you can specify packages that are only needed for the
pkgdown website of the package:
Config/Needs/website: r-lib/pkgdown
To use these dependency types, you need to specify them in the
r if (is_pak()) "\\code{dependencies}" else "\\code{deps}"
argument to
r pak_or_pkgdepends()
functions.
Note that Config/Needs/*
fields are currently not used from CRAN
packages, and packages in CRAN-like repositories in general.
Usually you specify that a Config/Needs/*
dependency type should be
installed together with "hard"
or "all"
, to install all hard or
soft dependencies as well.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.