From lecoutre at stat.ucl.ac.be  Tue Dec 14 15:49:07 2004
From: lecoutre at stat.ucl.ac.be (Eric Lecoutre)
Date: Tue Dec 14 15:56:34 2004
Subject: [Rd] Multiple options for a package
In-Reply-To: <Pine.LNX.4.61.0412141203080.8509@gannet.stats>
References: <6.0.1.1.2.20041214112754.03703ec0@stat4ux.stat.ucl.ac.be>
	<Pine.LNX.4.61.0412141203080.8509@gannet.stats>
Message-ID: <6.0.1.1.2.20041214153634.034d07b0@stat4ux.stat.ucl.ac.be>


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


[Rd] Multiple options for a package
Eric Lecoutre