From sfalcon at fhcrc.org  Mon Nov 21 22:16:37 2005
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Mon, 21 Nov 2005 13:16:37 -0800
Subject: [Rd] NAMESPACE, S4, and .onLoad
Message-ID: <m2veylzop6.fsf@fhcrc.org>

The Writing R Extensions manual instructs developers who use S4
classes and methods in a package with a name space to:

    There needs to be an .onLoad action to ensure that the methods package
    is loaded and attached:
    
         .onLoad <- function(lib, pkg) require(methods)

I'm wondering if listing methods in the Depends field of the package's
DESCRIPTION file is sufficient.  My understanding is that doing so
will result in the methods package being loaded and attached.

Best,

+ seth


Link to section in extension manual:
http://cran.r-project.org/doc/manuals/R-exts.html#Name-spaces-with-formal-classes-and-methods



[Rd] NAMESPACE, S4, and .onLoad
Seth Falcon