[Rd] how to store package options over sessions?

Simon Urbanek simon.urbanek at r-project.org
Mon Nov 22 17:20:16 CET 2010


I'm not sure why it was not mentioned do far, but the most obvious solution is to create a special object in the workspace (usually a hidden environment or a list - e.g. .myPackage.options.env). One advantage is that the user has full control over whether it should be save or not as it's tied to the workspace. On load the package can look for it and use it if it is what's expected (e.g., it may be worth using a specific class).

That said, in either case I think it's important to make it optional and document it well, because leaving files or objects around when not expected is impolite to say the least.

Cheers,
Simon


On Nov 20, 2010, at 11:12 AM, Mark Heckmann wrote:

> Hi,
> I posted this a week ago on r-help but did not get an answer. So I hope that someone here can help me:
> I want to define some options for my package the user may change.
> It would be convenient if the changes could be saved when terminating  
> an R session and recovered automatically on the next package load.
> 
> Is that possible and if yes, is the standard way to implement this?
> 
> Thanks,
> Mark
> 
> ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
> Mark Heckmann
> Dipl. Wirt.-Ing. cand. Psych.
> Celler Straße 27
> 28205 Bremen
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
> 
> 
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list