[Rd] Multiple options for a package
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Dec 14 16:04:14 CET 2004
On Tue, 14 Dec 2004, Eric Lecoutre wrote:
>
> Hi,
>
> Thanks Prof for this suggestion. I did get an insight into sm source code and
> will adopt a similar strategy.
>
> BTW, I am discovering unlockBinding, which will be convenient. I agree that
> package-related options should disappear when package is unload. But what
> happen if within the same session the user reattach the package? Should the
> package-default options be restored or the previously defined options kept.
> And from a session to an other?
Well, graphics parameters start from the defaults for each new device (and
each new session), and people don't seem to find that awkward. Package
hooks give users a way to set options at each invocation of a package
(?setHook), and even to save and restore them if they want.
>
> Best,
>
> Eric
>
>
>
> At 14:30 14/12/2004, Prof Brian Ripley wrote:
>> I don't see why package options need have anything to do with options(). It
>> seems to me that they really should be stored in the package namespace (and
>> so disappear when the package is detached). One package which does this is
>> 'sm' (although that has been ported from S-PLUS and is not the cleanest
>> R-only mechanism).
>>
>> I also don't see why you need to save options to file _within a session_,
>> and the R testing framework does not do so -- take a look at what
>> massage-examples does. But if you do save options, remember that some are
>> read-only. I think you would find .readRDS and allies (see the help page)
>> more convenient.
>
> Eric Lecoutre
> UCL / Institut de Statistique
> Voie du Roman Pays, 20
> 1348 Louvain-la-Neuve
> Belgium
>
> tel: (+32)(0)10473050
> lecoutre at stat.ucl.ac.be
> http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
>
> If the statistics are boring, then you've got the wrong numbers. -Edward
> Tufte
>
>
--
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