From ripley at stats.ox.ac.uk  Sat May 24 12:03:28 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat May 24 12:03:41 2003
Subject: [Rd] How to avoid function masking
In-Reply-To: <D7A3CFD7825BD6119B880002A58F06C202F2C9D3@groexmb02.pfizer.com>
Message-ID: <Pine.LNX.4.44.0305241058270.4728-100000@gannet.stats>

On Fri, 23 May 2003, Warnes, Gregory R wrote:

> 
> > -----Original Message-----
> > From: Martin Maechler [mailto:maechler@stat.math.ethz.ch]
> > Sent: Friday, May 23, 2003 9:00 AM
> > To: Warnes, Gregory R
> 
> > You checked wrongly. library() *does* for several days now.
> > (require doesn't -- on purpose?)
> 
> Yes, I was wrong.   have a typo in my script that calls rsync, and the
> updates went into a different directory, so the code that I was looking at
> was actually the released 1.7.0 code.
> 
> Looking at the new code, it appears that the pos argument only applies the
> the package explicitly named in library() and not to a any packages it
> loads.  Is this intentional?

Yes.  What a package does is its own business, not library's, and if you 
read the help file you will see that pos is computed *after* .First.lib is 
run.

Authors of packages which load up other packages need to take 
responsibility for what thay may do to the search path: at least now they 
can arrange to load those packages at the end (and we may well make that
easier to achieve, by letting pos="base" mean load immediately before 
base).

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] How to avoid function masking
Prof Brian Ripley