[Rd] S3 method for package listed in suggest/enhance

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Sep 15 15:08:48 CEST 2010



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
>
>
>



More information about the R-devel mailing list