Re: [Rd] how to store package options over sessions?

From: Dirk Eddelbuettel <edd_at_debian.org>
Date: Sat, 20 Nov 2010 11:51:28 -0600

On 20 November 2010 at 17:12, 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?

First off:

   R> fortunes:::fortune("yoda")    

   Evelyn Hall: I would like to know how (if) I can extract some of the    information from the summary of my nlme.    Simon Blomberg: This is R. There is no if. Only how.

   R>

Secondly, what you ask is necessarily rather OS-dependent. So of course it can be done, but probably in way that depend on your local circumstance.

Thirdly, and to make this a little more helpful, I frequently use the RSQLite package to cache data across sessions and invocations. For a large example, consider the CRANberries feed (http://dirk.eddelbuettel.com/cranberries/) which stores in SQLite what the the state of the (CRAN) world was the last it got woken up by crontab. I also have a few smaller ad-hoc things at work that do similar things.

Depending on your local circumstances you may make this 'cache' of stateful information read or read/write, make it a file on NFS or CIFS or WebDAV, make it a database that can be read as file or over sockets and so.

And Yoda still rules.

Dirk

-- 
Dirk Eddelbuettel | edd@debian.org | http://dirk.eddelbuettel.com

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 20 Nov 2010 - 17:55:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 20 Nov 2010 - 19:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive