Skip to content

[Bioc-devel] methods package is not attached in .onLoad for Biobase

2 messages · Florian Hahne, Seth Falcon

#
Hi everyone,
I just noticed some strange behaviour when starting R with a saved
workspace containing objects of class cytoFrame or cytoSet. These
classes are defined in my own package prada and make heavy use of
Biobase generics. I get the error

Error in .initContents() : couldn't find function "isGeneric"
Error: .onLoad failed in 'loadNamespace' for 'Biobase'
Fatal error: unable to restore saved data in .RData

When looking at the .onLoad function for Biobase I realized that the
methods package is not attached, thus isGeneric can not be found in the
call to .initContents().
Adding a required(methods) to .onLoad fixed this for me. To my
understanding, attaching methods is mandatory for every package that
uses the S4 system  (at least that's what's stated in the writing R
extensions documentation), so I guess it should be fixed?!

Best wishes,
Florian
#
Hi Florian,
On 2 Feb 2006, fhahne at gmx.de wrote:
Absolutely.  Thanks for the report.  A fix is in svn and will show up
in the devel repository within 24hrs or so.

Note to other package maintainers:

If your package has a NAMESPACE file and you define S4 classes or
methods, it is essential that you add a .onLoad function that looks
like this to your package:

  .onLoad <- function(libname, pkgname) {
      require("methods")
  }

Best,

+ seth