From ripley at stats.ox.ac.uk  Tue Feb 20 08:46:05 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 20 Feb 2007 07:46:05 +0000 (GMT)
Subject: [Rd] Custom per-package options passed down via library() ?
In-Reply-To: <17882.19097.558422.737418@basebud.nulle.part>
References: <17882.19097.558422.737418@basebud.nulle.part>
Message-ID: <Pine.LNX.4.64.0702200736530.1875@gannet.stats.ox.ac.uk>

Some packages have their own option-like mechanism, e.g. sm.
Others use environment variables for this purpose.
And there are userhooks for .First.lib, .onLoad and .onAttach that could 
be exploited.

In the Hmisc case, you are talking about messages, I believe.  You can 
handle those via message classes.  The latter is not as easy as I would 
like (and is currently under discussion), but in this particular case the 
message class 'packageStartupMessage' of R >= 2.5.0 seems to be what is 
wanted.

library() does not have a ... argument, so you cannot do what your subject 
line suggests.  Since library() is scheduled to be replaced by use() 
sometime Real Soon Now, it is not being enhanced but I think this is part 
of the goals for use().

On Mon, 19 Feb 2007, Dirk Eddelbuettel wrote:

>
> I want to load an in-house library 'differently' in a particular context and,
> to achieve this, would like to govern the behaviour of its .onLoad()
> function.
>
> In a related context, Frank Harrell and I have been wondering on and off
> about how to tell Hmisc to be less verbose in certain situations.  He
> achieves this by placing information in a custom field in options().
> I could do the same in my case -- but am wondering if there is a better way.
> Is there?
>
> Any hints welcome!
>
> Regards, Dirk
>
>

-- 
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



[Rd] Custom per-package options passed down via library() ?
Prof Brian Ripley