From proebuck at mdanderson.org  Mon Sep 19 19:30:57 2011
From: proebuck at mdanderson.org (Roebuck,Paul L)
Date: Mon, 19 Sep 2011 12:30:57 -0500
Subject: [Rd] FW: [Q] Package NS Hook Lint NOTE (unanswered)
In-Reply-To: <CA965453.2098B%proebuck@mdanderson.org>
Message-ID: <CA9CE681.20D91%proebuck@mdanderson.org>

Still have a question about the following NOTEs appearing on CRAN checks:

> .onLoad calls:
> require(methods)
> 
> Package startup functions should not change the search path.
> See section ?Good practice? in ?.onAttach.


For years, I have had the following in my S4-requiring packages.

##---------------------------------------------------------------------
.onLoad <- function(libname, pkgname) {
    ## In case namespace is loaded (via import) by package that
    ## doesn't depend on S4 methods and used in a session with
    ## non-default set of packages
    require(methods)
}

It was all based on an explanation Prof. Ripley gave to someone
about some package loading corner case (reference lost to history
though circa R-2.7 or before). Is it no longer an issue?

The 'methods' package is (in all cases) already listed in each package's
DESCRIPTION Depends entry. Under normal circumstances, is the require()
method in the .onLoad() actually altering the search path (since the
'methods' package was already a dependency)?



[Rd] FW: [Q] Package NS Hook Lint NOTE (unanswered)
Roebuck,Paul L