Re: [Rd] R CMD check and missing imports from base packages

2015-05-01 Thread Gábor Csárdi
On Thu, Apr 30, 2015 at 3:44 AM, Martin Maechler < maech...@lynne.stat.math.ethz.ch> wrote: [...] > > If I have understood your main point correctly, you are > suggesting that 'R CMD check' should start putting out a NOTE > when package code calls a function from one of a set of > "standard packa

Re: [Rd] R CMD check and missing imports from base packages

2015-04-30 Thread Martin Maechler
> Gábor Csárdi > on Wed, 29 Apr 2015 23:07:09 -0400 writes: > On Wed, Apr 29, 2015 at 8:12 PM, Paul Gilbert wrote: >> >> As I recall, several packages mask the simulate generic in stats, if you >> are looking for examples. >> > FWIW, here is a list of base

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 8:12 PM, Paul Gilbert wrote: > > As I recall, several packages mask the simulate generic in stats, if you > are looking for examples. > FWIW, here is a list of base* functions masked** by CRAN packages: https://github.com/gaborcsardi/rfunctions/blob/master/rfunctions.md Lo

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Paul Gilbert
On 04/29/2015 05:38 PM, William Dunlap wrote: And in general a developer would avoid masking a function in a base package, so as not to require the user to distinguish between stats::density() and igraph::density(). Maybe the example is not meant literally. The 'filter' function in the popula

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread William Dunlap
> And in general a developer would avoid masking a function > in a base package, so as not to require the user to distinguish > between stats::density() and igraph::density(). Maybe the > example is not meant literally. The 'filter' function in the popular 'dplyr' package masks the one that has be

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 4:24 PM, Martin Morgan wrote: > On 04/28/2015 01:04 PM, Gábor Csárdi wrote: > [...] > E.g. if package 'ggplot2' uses 'stats::density()', and package 'igraph' >> also defines 'density()', and 'igraph' is on the search path, then >> 'ggplot2' will call 'igraph::density()' i

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Martin Morgan
On 04/28/2015 01:04 PM, Gábor Csárdi wrote: When a symbol in a package is resolved, R looks into the package's environment, and then into the package's imports environment. Then, if the symbol is still not resolved, it looks into the base package. So far so good. If still not found, it follows t

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 3:24 PM, Duncan Murdoch wrote: [...] > Yes, people can do this already. But why not help them with a NOTE if they >> don't know that this is good practice, or they just simply forget? >> > > I suspect the reason for this is historical: at the time that the current > warni

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 3:28 PM, John Nolan wrote: [...] > 1. have R CMD check show how every external function reference gets > resolved. > That's not possible, because it depends on the currently attached packages, and even on the order of their attachment. > 2. have R CMD check warn anytime

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread John Nolan
To: Gabriel Becker , Cc: "r-devel@r-project.org" Date: 04/29/2015 01:57 PM Subject: Re: [Rd] R CMD check and missing imports from base packages Sent by:"R-devel" On Wed, Apr 29, 2015 at 1:45 PM, Gabriel Becker wrote: > Gabor, > > T

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Duncan Murdoch
On 29/04/2015 1:57 PM, Gábor Csárdi wrote: On Wed, Apr 29, 2015 at 1:45 PM, Gabriel Becker wrote: > Gabor, > > To play devil's advocate a bit, why not just have the package formally > import the functions it wants to use (or the whole package if that is > easier)? > This is exactly my goal. A

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 1:45 PM, Gabriel Becker wrote: > Gabor, > > To play devil's advocate a bit, why not just have the package formally > import the functions it wants to use (or the whole package if that is > easier)? > This is exactly my goal. And to facilitate this, R CMD check could remi

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gabriel Becker
Gabor, To play devil's advocate a bit, why not just have the package formally import the functions it wants to use (or the whole package if that is easier)? Also, if your package Depends on another package, instead of importing it (e.g. because the end user will need functions in it in order to m

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Gábor Csárdi
On Wed, Apr 29, 2015 at 12:53 PM, Winston Chang wrote: > On Tue, Apr 28, 2015 at 3:04 PM, Gábor Csárdi > wrote: > > > > > > E.g. if package 'ggplot2' uses 'stats::density()', and package 'igraph' > > also defines 'density()', and 'igraph' is on the search path, then > > 'ggplot2' will call 'igra

Re: [Rd] R CMD check and missing imports from base packages

2015-04-29 Thread Winston Chang
On Tue, Apr 28, 2015 at 3:04 PM, Gábor Csárdi wrote: > > > E.g. if package 'ggplot2' uses 'stats::density()', and package 'igraph' > also defines 'density()', and 'igraph' is on the search path, then > 'ggplot2' will call 'igraph::density()' instead of 'stats::density()'. Just to be clear: you m

[Rd] R CMD check and missing imports from base packages

2015-04-28 Thread Gábor Csárdi
When a symbol in a package is resolved, R looks into the package's environment, and then into the package's imports environment. Then, if the symbol is still not resolved, it looks into the base package. So far so good. If still not found, it follows the 'search()' path, starting with the global e