Prof Brian Ripley
2004-Aug-12 14:35 UTC
[Rd] The Depends: field of a package is now used by library()
In R-devel, the Depends: field in the DESCRIPTION file is now used by library() to load the named packages before the current package, and also to set up the environment to save images and prepare for lazy loading. Would authors please use a minimally necessary set of packages in Depends, and put others in Suggests: -- the distinction is made in `Writing R Extensions'. On the other hand, do include standard packages like graphics, stats and utils if needed, as R can be run without these. (For example, packages which define S4 methods for plot do depend on graphics and may fail if graphics is loaded after them.) There is a little danger of cycles in dependencies if there are unnecessary entries, and load time will be slowed (although with lazy-loading that is a much smaller penalty than it used to be). This change should enable the installation procedure to be simplified for packages which save images -- you can probably omit both install.R and R_PROFILE.R and use fields in DESCRIPTION instead -- see `Writing R Extensions'. More details of recommended changes will appear on the developer site nearer release time. -- Brian D. Ripley, ripley@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
Deepayan Sarkar
2004-Aug-12 16:42 UTC
[Rd] The Depends: field of a package is now used by library()
On Thursday 12 August 2004 07:34, Prof Brian Ripley wrote:> In R-devel, the Depends: field in the DESCRIPTION file is now used by > library() to load the named packages before the current package, and > also to set up the environment to save images and prepare for lazy > loading.How would this relate to namespaces? For instance, lattice imports grid (and a few things from stats and graphics). If I keep grid in the depends field, loading lattice does a require(grid), which defeats one of the purposes of having namespaces. If I leave it out, nothing bad seems to happen as long as grid is installed, but there should be some indication in the DESCRIPTION that that grid is a requirement. None of the other fields seem appropriate. Deepayan
Wolfgang Huber
2004-Aug-12 17:18 UTC
[Rd] The Depends: field of a package is now used by library()
> On Thursday 12 August 2004 07:34, Prof Brian Ripley wrote: > >>In R-devel, the Depends: field in the DESCRIPTION file is now used by >>library() to load the named packages before the current package, and >>also to set up the environment to save images and prepare for lazy >>loading. >Are circular dependencies allowed? Or do they need to be broken, e.g. by replacing one of the edges in a loop by a "suggests"? Best wishes Wolfgang -- ------------------------------------- Wolfgang Huber Division of Molecular Genome Analysis German Cancer Research Center Heidelberg, Germany Phone: +49 6221 424709 Fax: +49 6221 42524709 Http: www.dkfz.de/abt0840/whuber
Prof Brian Ripley
2004-Aug-12 17:28 UTC
[Rd] The Depends: field of a package is now used by library()
On Thu, 12 Aug 2004, Wolfgang Huber wrote:> > On Thursday 12 August 2004 07:34, Prof Brian Ripley wrote: > > > >>In R-devel, the Depends: field in the DESCRIPTION file is now used by > >>library() to load the named packages before the current package, and > >>also to set up the environment to save images and prepare for lazy > >>loading. > > > > Are circular dependencies allowed? > Or do they need to be broken, e.g. by replacing one of the edges in a > loop by a "suggests"?They need to be broken. I only encountered them where Suggests: was appropriate. -- Brian D. Ripley, ripley@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