[R] Specifying package dependencies

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Jul 25 19:17:38 CEST 2009



Christopher Bare wrote:
> Hi,
> 
> I'm trying to put together an R package. My library has dependencies
> on three other libraries: RSQLite, gaggle (a component of
> Bioconductor), and another package that is available as a download
> from the author's website.
> 
> Is it possible to specify each of those dependencies in such a way
> that they will be automatically installed when a user installs my
> library? I'd like to save the end user from a lengthy series of
> install steps, if possible.
> 
> I've looked in the Writing R Extensions document, but am probably
> failing to understand most of it.


It should work right away for packages in the same repository - say CRAN.

> If I put a bioconductor package in the Depends line of the DESCRIPTION
> file, should I expect that to just work? It seems like it doesn't.


In that case the user needs to declare that the Bioconductor repository 
has to be used additionally. But the user does not need to select any 
package.


> For the case where I need to download a .tgz file from the author's
> page, is there a way to fetch and install that when my library is
> being installed? Maybe in a configure script?


That's hard, because you do not know the correct way of getting it on 
arbitrary platforms. Hence I'd recommend to make a note that that 
package is required and users need to install it at first.

Uwe Ligges


> Is this a practical thing to try and do? Thanks for any advise!
> 
> -Chris
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list