[R] Calling optim and .C

Armin Meier axionator at gmail.com
Wed Nov 5 23:39:06 CET 2008

Hi all,
I want to optimize a function fn using optim. This function fn calls
the .C function in it with a function name and arguments given to fn,
i.e. something like this pseudocode:

fn <- function(par, "some params for fn") {... .C("Cfunction", ...) ...}
optim(par, fn, "some params for fn")

In my case this doesn't work, but is it possible in general and I made
some error?

Thanks in advance

More information about the R-help mailing list