From h.wickham at gmail.com  Sun Feb 25 15:57:53 2007
From: h.wickham at gmail.com (hadley wickham)
Date: Sun, 25 Feb 2007 08:57:53 -0600
Subject: [Rd] Depending on many packages: another best practice question
In-Reply-To: <Pine.LNX.4.64.0702242013310.15657@gannet.stats.ox.ac.uk>
References: <f8e6ff050702231738x74d515c1pd246403fdf8ad21a@mail.gmail.com>
	<Pine.LNX.4.64.0702241828570.14494@gannet.stats.ox.ac.uk>
	<f8e6ff050702241121q1890ab16sff1d19bbb432eff6@mail.gmail.com>
	<Pine.LNX.4.64.0702242013310.15657@gannet.stats.ox.ac.uk>
Message-ID: <f8e6ff050702250657i1ff01035je267f64a5d584b85@mail.gmail.com>

On 2/24/07, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Sat, 24 Feb 2007, hadley wickham wrote:
>
> >> > ggplot currently requires 13 packages (grid, reshape, RColorBrewer,
> >> > proto, splines, MASS, Hmisc, boot, butler, hexbin, mapproj, quantreg,
> >> > sm).  Some of these are absolutely necessary (eg. proto), but most are
> >> > used for one or two specific tasks (eg. boot is only used to get
> >> > plogis, used for logit scales).
> >>
> >> Hmm, there is no plogis in boot, but there is in stats.
> >
> > Oops, I had originally included it to use logit and inv.logit, but
> > then realised I could use plogis etc instead.  That's one dependency
> > down.
> >
> >>
> >> > Do you think I should make them all "depends" packages, or "suggests"
> >> > packages, and then manually test for package presence before using a
> >> > certain function?  What is easier for users?
> >>
> >> The second, especially as from 2.5.0 the 'Depends' and 'Imports' are
> >> installed by default.
> >
> > Ok, that makes sense then.
> >
> >> What you have not mentioned is that those packages also have dependencies.
> >>
> >> Using 'Depends' on a non-CRAN package (e.g. hexbin) is definitely awkward
> >> for the user/sysadmin and I would try to avoid it.
> >
> > It's frustrating enough for the windows user, as suggests packages
> > seem to get installed by default as well.
>
> Prior to 2.5.0, yes, but not in future.

Great.  One more question:  do you have any suggstion for you I should
deal with examples?  Do I have to wrap those in conditional require
statements as well?  That seems to be the way to get R CMD check to
pass, but adds (unnecessary?) repitition.

Hadley



[Rd] Depending on many packages: another best practice question
hadley wickham