[Rd] namespace, S4 and import

From: Kasper Daniel Hansen <khansen_at_stat.berkeley.edu>
Date: Mon, 15 Oct 2007 11:43:23 -0700


I have been using a bit of namespaces in the past, but the following alludes me.

I am dealing with the Bioconductor packages Biobase and affy. Biobase has a namespace and affy does not. affy contains the S4 class
"AffyBatch" which extends the "eSet" class in Biobase.

I am extending the AffyBatch class myself. My code works fine as long as I do not have any NAMESPACE file.

Now I am trying to add one. I am importing Biobase, but I cannot import affy since it does not have a NAMESPACE. However, when I try R CMD INSTALL it complains that it cannot find AffyBatch :

Error in setIs(Class, class2, classDef = classDef, where = where) :

   Unable to find package environment for class "AffyBatch" to revise subclass information

So how do I make the classes in affy available for my package when affy does not have a NAMESPACE?

The relevant lines from my DESCRIPTION file is

   Depends: R (>= 2.6), affy (>= 1.16), affxparser (>= 1.10), Biobase, methods

   LazyLoad: yes

and from my NAMESPACE file I have


I have also tried (in desperation) to add a "require(affy)" in both .onLoad and .onAttach, but to no help.

While I am at this: as I remember it, in the old days we needed
"require(methods)" in .onLoad to work with S4, is that still necessary?

I am using R-2.6.0 on OS X (PPC)

Thanks, Kasper

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 15 Oct 2007 - 18:46:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.