From simon.urbanek at r-project.org  Mon Nov 22 17:20:16 2010
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 22 Nov 2010 11:20:16 -0500
Subject: [Rd] how to store package options over sessions?
In-Reply-To: <1CD42D9B-8CD0-42E8-96DE-9F46327E8E60@gmx.de>
References: <1CD42D9B-8CD0-42E8-96DE-9F46327E8E60@gmx.de>
Message-ID: <A96ADCB6-6123-43F9-A7C5-0E8C39D1E910@r-project.org>

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



[Rd] how to store package options over sessions?
Simon Urbanek