[Bioc-devel] annotation data in package

Martin Morgan mtmorgan at fhcrc.org
Mon Nov 2 18:27:13 CET 2009

Hi Martino --

see ?.onLoad for evaluating code when the package is loaded. Basically,
include in your package a function

.onLoad <- function(libname, pkgname)
   <your code here>


Martino Barenco wrote:
> Dear list,
> I am maintaining a package (rHVDM) and I have the following problem. One
> of the commands in the package needs as input, plattform-specific data.
> I started by putting the plattform-specific data in the data directory
> of the package but this required, on the part of the user, to load the
> data first (with a command data(...)) prior to using the command. In a
> bid to avoid that step I have embedded the relevant tables directly in
> one of the .R files. However this is not terribly elegant, if not
> completely wrong from a programming point of view. Moreover, these
> tables will be growing in size which makes the present situation even
> more shaky.
> So, is there a way, upon loading the package to automatically load these
> data too, and how? (for example, the affy package recognizes the main
> affy chips).
> In advance, many thanks
> Martino
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

More information about the Bioc-devel mailing list