On Tue, May 15, 2007 at 07:02:56PM +0100, Prof Brian Ripley wrote:
> In R you rarely need to pass additional arguments in programming as 
> lexical scoping can be used to capture them.

You can also use currying, like this:

        ll <- function(data) function(params)
        {
                # compute whatever you want with data and params.
        }

Then you can call optim like this:

        optim(initial.param, ll(some.data))

Cheers,
Andrew

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to