Skip to content
Prev 9646 / 12125 Next

[R-pkg-devel] DESCRIPTION file Imports of base R packages

On Tue, Oct 3, 2023 at 7:46?AM Jan Gorecki <j.gorecki at wit.edu.pl> wrote:
You do *not* have to declare base-R packages as dependencies in the
DESCRIPTION file.  'R CMD check' and 'R CMD check --as-cran' will not
complain about them.

I can't speak for others, but, I choose to declare all(*) my base-R
package dependencies in my DESCRIPTION files for a reason.  This makes
it explicit what packages my package rely on, including which of the
base-R packages.  For instance, it's nice to be able to tell when the
'parallel' or 'tcltk' package is used from the DESCRIPTION file (and
the online CRAN package page, if on CRAN).

(*) The exception is the 'base' package, because that is such a
fundamental package in R and is always loaded.  The other base-R
packages are theoretically optional when it comes to running R, e.g.

$ R_ENABLE_JIT=0 Rscript --vanilla --default-packages=base -e
"loadedNamespaces()"
[1] "base"

/Henrik