[R] installing package with version number using namespaces & dynamic library

Matthias Burger matthias.burger at epigenomics.com
Wed Aug 4 14:58:32 CEST 2004



Prof Brian Ripley wrote:
> On Wed, 4 Aug 2004, Matthias Burger wrote:
> 
> 
>>I wonder whether a package with namespace & dynamic library can be installed 
>>with the version number attached, ie. with the argument --with-package-versions. 
>>Is this currently possible?
> 
> 
> I've just successfully done this with package tree, so yes.
> 
> gannet% R CMD INSTALL --with-package-versions tree_1.0-16.tar.gz
> gannet% R
> ...
> 
>>library(tree)
>>library(tree, version="1.0-16")
> 
> 
> both work.
> 
> The crucial piece of code in namespace loading is
> 
>         # load any dynamic libraries
>         for (lib in nsInfo$dynlibs)
>             library.dynam(lib, package, package.lib)
> 
> which is *not* the call to library.dynam you quote.  I think you have a
> call to library.dynam in your .onLoad, rather than/as well as using the
> useDynLib directive.  .onLoad *is* run with the versioned package name as 
> its `pkgname' argument, and we should document that.
> 
Spot on! This indeed was my oversight, removing
library.dynam(pkg, pkg, lib) from the .onLoad function resolved the problem.

Thanks for the prompt help!

Best,

   Matthias


-- 
Matthias Burger                     Project Manager/ Biostatistician
Epigenomics AG    Kleine Praesidentenstr. 1    10178 Berlin, Germany
phone:+49-30-24345-371                          fax:+49-30-24345-555
http://www.epigenomics.com           matthias.burger at epigenomics.com




More information about the R-help mailing list