[Rd] import of Namespaces

From: Matthias Kohl <Matthias.Kohl_at_stamats.de>
Date: Mon 28 Nov 2005 - 11:16:33 GMT

Dear R devels,

let's say I have three packages "pkg1", "pkg2" and "pkg3" which all contain new S4 classes and methods. Where "pkg3" depends on "pkg2" and
"pkg2" depends on "pkg1". Moreover, all three packages have namespaces.

  1. I use ".onLoad <- function(lib, pkg) require(methods)". Do I also have to import the namespace of "methods" package?
  2. If I use import("pkg1") in the namespace of "pkg2", does this also (correctly) import the S4 classes and methods of "pkg1"? Or do I explicitly have to use importClassesFrom resp. importMethodsFrom?
  3. If I import the Namespace of "pkg2" in "pkg3", where the namespace of
    "pkg2" has import("pkg1") (or maybe importClassesFrom,
    importMethodsFrom) and I also want to use S4 classes and methods of
    "pkg1" in "pkg3". Is it sufficient to have import("pkg2") in the
    Namespace of "pkg3" or do I need import("pkg1") and import("pkg2")?

Many thanks for your help and advice

StaMatS - Statistik + Mathematik Service
Dipl.Math.(Univ.) Matthias Kohl

R-devel@r-project.org mailing list
Received on Mon Nov 28 22:51:45 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:34 GMT