From felix at nfrac.org  Mon Jul 28 15:15:19 2008
From: felix at nfrac.org (Felix Andrews)
Date: Mon, 28 Jul 2008 23:15:19 +1000
Subject: [Rd] equivalent to "require" for imports? (cairoDevice)
Message-ID: <94730b8a0807280615v664236afm65505355a1a35da9@mail.gmail.com>

Hi R-devel

I use the packages RGtk2 and cairoDevice. The cairoDevice package has
a few stand-alone functions, plus "asCairoDevice" which depends on
RGtk2 and calls require(RGtk2). So cairoDevice lists RGtk2 under
"Suggests" in the DESCRIPTION file. It can not Import RGtk2 because
that would force all users to install RGtk2.

The upshot of this is, if you *import* the RGtk2 namespace into
another package and then call asCairoDevice(), RGtk2 is attached to
the user's search path. That is significant because RGtk2 exports a
large number of objects: -- 7476 to be exact -- which can clog up
things like help.search and autocompletion.

What is the recommended solution? Could asCairoDevice call
loadNamespace rather than require?

-- 
Felix Andrews / ???
PhD candidate
Integrated Catchment Assessment and Management Centre
The Fenner School of Environment and Society
The Australian National University (Building 48A), ACT 0200
Beijing Bag, Locked Bag 40, Kingston ACT 2604
http://www.neurofractal.org/felix/
3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8



[Rd] equivalent to "require" for imports? (cairoDevice)
Felix Andrews