[R-pkg-devel] package dependencies not detected?

Dirk Eddelbuettel edd at debian.org
Wed Aug 16 16:21:19 CEST 2017


On 16 August 2017 at 09:44, Duncan Murdoch wrote:
| On 16/08/2017 8:31 AM, Dirk Eddelbuettel wrote:
| >
| > On 16 August 2017 at 12:51, peter dalgaard wrote:
| > | > On 16 Aug 2017, at 11:11 , Berry Boessenkool <berryboessenkool at hotmail.com> wrote:
| > | >
| > | > if a function in a package uses graphics::legend in the code, but does not import it in the namespace, shouldn't there be a warning in the check?
| > | >
| > |
| > | Er, no... Importing into a namespace is used to avoid the graphics:: qualifier. This is conceptually different from having a dependency.
| >
| > Exactly, but IIRC we get warnings on packages not listed in Suggests: which are
| > accessed via '::'.  And that need for a Suggests: goes away for a base package.
| 
| s/Suggests/Imports/g

Yes, I wasn't perfectly clear but Suggests: is what I have in a (smaller,
still local, still experimental) package where I have only

  Description: A collection of utility functions.
  Suggests: anytime, data.table, zoo, xts, TTR, quantmod

ie not a single Depends: or Imports: or LinkingTo: and all use in R/ is
prefixed by double colon.

And in that case I do not need Suggests: for base packages I use.

But yes, in the general case, one would have NAMESPACE and importFrom(...)
along with an Imports:

Dirk, who has now beaten that poor horse of Berry into utter pulp
 
| >
| > Otherwise Peter's reminder is entirely correct. You can do _either_ an
| >   importForm("graphics", "plot", "legend") in NAMESPACE (which I have done)
| > or use the explicit
| >   graphics::legend
| > you have.
| >
| > Dirk
| >
| 

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-package-devel mailing list