From ripley at stats.ox.ac.uk  Thu Sep 21 20:38:15 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 21 Sep 2006 19:38:15 +0100 (BST)
Subject: [Rd] Package dependencies and imports
In-Reply-To: <17682.46130.408226.90557@stat.math.ethz.ch>
References: <20060921152216.UGBW24981.tomts40-srv.bellnexxia.net@JohnDesktop8300>
	<17682.46130.408226.90557@stat.math.ethz.ch>
Message-ID: <Pine.LNX.4.64.0609211936460.4448@gannet.stats.ox.ac.uk>

On Thu, 21 Sep 2006, Martin Maechler wrote:

>>>>>> "JohnF" == John Fox <jfox at mcmaster.ca>
>>>>>>     on Thu, 21 Sep 2006 11:22:17 -0400 writes:
>
>    JohnF> Dear list members,
>
>    JohnF> I'm encountering the following problem with package dependencies and
>    JohnF> imports:
>
>    JohnF> The Rcmdr package doesn't declare a formal dependency
>    JohnF> (via depends or suggests in the package DESCRIPTION)
>    JohnF> on the rgl package because the latter apparently
>    JohnF> causes problems on some systems. This allows the
>    JohnF> Rcmdr package to build and check on systems without
>    JohnF> rgl present; if rgl isn't present, then menu items
>    JohnF> using it are disabled (in the development version of
>    JohnF> the Rcmdr package, not installed in the first place).
>
>    JohnF> If rgl is present, however, the Rcmdr package uses
>    JohnF> some unexported functions in it. I've done this via
>    JohnF> rgl::: to avoid importing from the rgl namespace:
>    JohnF> Because rgl isn't declared as a dependency, I can't
>    JohnF> import its namespace. In the current R 2.4.0 alpha
>    JohnF> and R 2.5.0 devel, however, using rgl::: generates a
>    JohnF> warning when the package is checked.
>
>    JohnF> Is there a way around this short of literally copying the unexported
>    JohnF> functions in rgl that Rcmdr uses?
>
> I think you should use the new DESCRIPTION field and say
>  'Enhances: rgl'
>
> but I haven't checked if this prevents the warning,  though I
> think it should..

It does, and Suggests: would also be fine.  install.packages() can be 
tuned as the degree of dependencies which it (optionally) downloads, and 
rgl is available for Windows (where from the menus there is less control).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




[Rd] Package dependencies and imports
Prof Brian Ripley