[R-pkg-devel] Dependencies in DESCRIPTION: Imports vs. Suggests

Paul Hargarten h@rg@rtenp @ending from mym@il@vcu@edu
Mon Nov 19 20:59:20 CET 2018


Hi all,

I am relatively new in creating R packages. I have created a new package
called *"foo"* and submitted it to CRAN for review.
I am wondering the difference between "Imports" and "Suggests" dependencies
in DESCRIPTION file.  According to my understanding, the "Imports" field
contains all packages required for my functions to work; the "suggests"
field contains packages that* foo* uses but doesn't require them. Programmers
place these suggested packages to run examples, to run tests, and build
vignettes, according to Hadley Wickham (also see
  <http://r-pkgs.had.co.nz/description.html
<http://r-pkgs.had.co.nz/description.html> >).  I think that this field
exists to limit the user the burden of downloading extra packages.

As suggested packages are not installed, I should add the following line in
examples that use this package. For instance,* abind* was listed as a
suggested package for *foo;* so I should add this line anywhere before I
use any functions in *abind. *
*      > if( !requireNamespace("abind", quietly = TRUE) )
{  install.packages("abind")}*

But I got an error from CRAN that I should not install packages in the
examples. I suppose that these packages should be in the "Import" field in
DESCRIPTION file. But, I am confused why that would be the case given that
these packages were used in the examples only and not in any functions in
*foo. *

Thus, I am wondering how you decide which packages are suggested compared to
 imported.


-- 
Paul Hargarten, M.S.
PhD Candidate
Biostatistics,  VCU School of Medicine
Biochemistry and Molecular Biology, B.S.;  Chemistry, B.A. ; Mathematics,
minor
hargartenp using vcu.edu

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list