Re: [R] Automatical download of needed packages from CRAN

From: Prof Brian Ripley <>
Date: Fri 29 Sep 2006 - 07:59:49 GMT

On Fri, 29 Sep 2006, Søren Højsgaard wrote:

> I write a package foo which requires a package bar (from CRAN) to work.
> So in the DESCRIPTION file I write Depends: bar. I would like it to be
> so that when one installs foo, then it is automatically checked whether
> bar is installed, and if not then bar is also installed at the same
> time. I remember having seen packages which do so, but I can not figure
> out the mechanism 'Depends: bar' in the DESCRIPTION file does not solve
> the problem. Can anyone help?

It does if you use install.packages(dependencies=TRUE), the default from the Windows GUI menu.

> A related question: How to check programmatically that a specific
> package is loaded?

Via search(): there are lots of examples in the R help files. ?termplot is one.

> Best regards
> Søren
> [[alternative HTML version deleted]]

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.

Received on Fri Sep 29 18:02:47 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 29 Sep 2006 - 08:30:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.