Skip to content
Prev 45219 / 63424 Next

Recommended way to call/import functions from a Suggested package

On 02/26/2013 05:28 PM, Simon Urbanek wrote:
Here is what the "Writing R Extensions" manual says:

   The ?Suggests? field uses the same syntax as ?Depends? and lists
   packages that are not necessarily needed. This includes packages
   used only in examples, tests or vignettes (see Writing package
   vignettes), and *packages loaded in the body of functions*.

Then some examples are provided and they mostly focus on suggested
packages used in examples, tests or vignettes. I couldn't find
anywhere that ``a package must work without "suggests" dependencies
in the entirety''.

AFAIK there are many valid situations where one wants to provide
some additional functionalities in his/her package via suggested
packages. A typical example being a front-end function that supports
different back-ends defined in different packages: the default
back-end will generally be in Depends or Imports, the alternative
back-ends in Suggests. If the user specifies a back-end (thru
some argument passed to the front-end) that is not installed,
then s/he'll get an error.

I don't need to hide this deficiency by not calling the functions
that fail in my examples (or tests). I'll just call my front-end
without specifying an alternative back-end. Not a big deal if my
function generates a plot and if using the alternative back-end
would basically produce the same plot with only some small cosmetic
differences.

Cheers,
H.

  
    

Thread (22 messages)

Davor Cubranic Recommended way to call/import functions from a Suggested package Feb 22 Hadley Wickham Recommended way to call/import functions from a Suggested package Feb 22 David Winsemius Recommended way to call/import functions from a Suggested package Feb 22 David Winsemius Recommended way to call/import functions from a Suggested package Feb 22 Mark Leeds Recommended way to call/import functions from a Suggested package Feb 22 Mark Leeds Recommended way to call/import functions from a Suggested package Feb 22 Simon Urbanek Recommended way to call/import functions from a Suggested package Feb 22 Hadley Wickham Recommended way to call/import functions from a Suggested package Feb 22 Berwin A Turlach Recommended way to call/import functions from a Suggested package Feb 22 Davor Cubranic Recommended way to call/import functions from a Suggested package Feb 25 Davor Cubranic Recommended way to call/import functions from a Suggested package Feb 25 Hadley Wickham Recommended way to call/import functions from a Suggested package Feb 25 Martin Morgan Recommended way to call/import functions from a Suggested package Feb 25 Hadley Wickham Recommended way to call/import functions from a Suggested package Feb 25 Davor Cubranic Recommended way to call/import functions from a Suggested package Feb 25 Milan Bouchet-Valat Recommended way to call/import functions from a Suggested package Feb 26 Hervé Pagès Recommended way to call/import functions from a Suggested package Feb 26 Simon Urbanek Recommended way to call/import functions from a Suggested package Feb 26 Hervé Pagès Recommended way to call/import functions from a Suggested package Feb 26 Simon Urbanek Recommended way to call/import functions from a Suggested package Feb 26 Hervé Pagès Recommended way to call/import functions from a Suggested package Feb 26 Simon Urbanek Recommended way to call/import functions from a Suggested package Feb 27