From ligges at statistik.tu-dortmund.de  Wed Sep 15 15:08:48 2010
From: ligges at statistik.tu-dortmund.de (Uwe Ligges)
Date: Wed, 15 Sep 2010 15:08:48 +0200
Subject: [Rd] S3 method for package listed in suggest/enhance
In-Reply-To: <AANLkTinP-oDc=EHUvFZi3ShsiYwrMeMhi3xEbxyyEBp9@mail.gmail.com>
References: <AANLkTinP-oDc=EHUvFZi3ShsiYwrMeMhi3xEbxyyEBp9@mail.gmail.com>
Message-ID: <4C90C560.1090100@statistik.tu-dortmund.de>



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



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