From nashjc at uottawa.ca  Tue May 15 16:16:02 2012
From: nashjc at uottawa.ca (John C Nash)
Date: Tue, 15 May 2012 10:16:02 -0400
Subject: [Rd] How to set up an object to share data across diverse functions
In-Reply-To: <mailman.21.1337076008.29272.r-devel@r-project.org>
References: <mailman.21.1337076008.29272.r-devel@r-project.org>
Message-ID: <4FB26522.3060100@uottawa.ca>

In the past 6 months I've been struggling with an issue that has been raised periodically
on the lists. This is the need to share information across a group of functions, possibly
from different packages. So far I've found solutions that are either quite clumsy or else
don't work as have (likely incorrectly) read the manuals.

I'll be writing up my experiences as a way to help others, but am wondering if there is an
accepted way to establish an object that can be read and written by a number of functions.
I'm currently using list2env to create a list under the "umbrella" function, and if
necessary pass this to other functions by name through the dot arguments, though
preferably I'd rather use a pre-arranged and fixed name (this does not seem to work unless
the object is in the global environment, and then I've occasionally had locked bindings
errors, which I'll freely admit I don't understand at all). I also have to be very careful
with dot arguments, especially if they are matrices.

I've a couple of examples, but they are pretty long, so I'll save for off-list transmission.

JN



[Rd] How to set up an object to share data across diverse functions
John C Nash