[Rd] Multiple options for a package

Eric Lecoutre lecoutre at stat.ucl.ac.be
Tue Dec 14 15:49:07 CET 2004


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?

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



More information about the R-devel mailing list