[Rd] How to avoid function masking

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat May 24 12:03:28 MEST 2003


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

> 
> > -----Original Message-----
> > From: Martin Maechler [mailto:maechler at 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 at 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



More information about the R-devel mailing list