Hi all, The profr package provides a method for displaying its output with ggplot: ggplot.print. You don't need this ggplot2 to use profr, so ggplot2 is listed under enhances in the DESCRIPTION file. If I have just S3method(ggplot, profr) in my NAMESPACE, then I get: ** testing if installed package can be loaded Error : object 'ggplot' not found whilst loading namespace 'profr' ERROR: loading failed If I have both S3method(ggplot, profr) and importFrom(ggplot2, ggplot), then I get: * checking package dependencies ... ERROR Namespace dependency not required: ggplot2 What's the correct way of exporting an S3 method for a generic in a suggested package? Thanks, Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/
On 01.09.2010 17:38, Hadley Wickham wrote:> Hi all, > > The profr package provides a method for displaying its output with > ggplot: ggplot.print. You don't need this ggplot2 to use profr, so > ggplot2 is listed under enhances in the DESCRIPTION file. > > If I have just S3method(ggplot, profr) in my NAMESPACE, then I get: > > ** testing if installed package can be loaded > Error : object 'ggplot' not found whilst loading namespace 'profr' > ERROR: loading failed > > If I have both S3method(ggplot, profr) and importFrom(ggplot2, > ggplot), then I get: > > * checking package dependencies ... ERROR > Namespace dependency not required: ggplot2 > > What's the correct way of exporting an S3 method for a generic in a > suggested package?I think you need to declare it as a Depends, since it has to be available for getting the Namespace directives right. Uwe> Thanks, > > Hadley > > >
Possibly Parallel Threads
- Errors while compiling packages with namespace?
- NAMESPACE and imports
- namespace S3 and S4 generic imports cannot both be satisfied:
- Correct NAMESPACE approach when writing an S3 method for a generic in another package
- strange behaviour of importFrom directive in name space