[Rd] optim bug (PR#9684)

Andrew Clausen clausen at econ.upenn.edu
Tue May 15 20:13:25 CEST 2007

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))


More information about the R-devel mailing list