Thanks to Hadley, William and Duncan for suggestions. I'm currently
implementing a
solution that is close to that of William and Duncan (and learning more about
environments
in the process). I suspect the reference classes are possibly a more reliable
long term
solution. I'll plead laziness unt
On 05/04/2012 4:20 PM, John C Nash wrote:
In trying to streamline various optimization functions, I would like to have a
scratch pad
of working data that is shared across a number of functions. These can be
called from
different levels within some wrapper functions for maximum likelihood and ot
> Make OPCON an environment and pass it into the functions that may read it or
> alter it. There
> is no real need to pass it out, since environments are changed in-place
> (unlike lists). E.g.,
> > x <- list2env(list(one=1, two="ii", three=3))
> > x
>
> > objects(x)
> [1] "one" "three"
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of John C Nash
> Sent: Thursday, April 05, 2012 1:20 PM
> To: r-help@r-project.org
> Subject: [R] Appropriate method for sharing data across functions
>
> In trying to streamline
Why not pass around a reference class?
Hadley
On Thu, Apr 5, 2012 at 3:20 PM, John C Nash wrote:
> In trying to streamline various optimization functions, I would like to have
> a scratch pad of working data that is shared across a number of functions.
> These can be called from different levels
5 matches
Mail list logo