Please allow me to clarify my original question. What I really need to be able to do it is to take arbitrary functions and evaluate them for arbitrary parameter values. I'm doing the optimization myself, so I need to be able to take a user's function and evaluate them at the current parameter values during my optimization process. So it would look something like this:
opt.fun <- function(user.formula, param.values) { #--- I would do some optimization here ---# fitted.values <- eval.fun(user.formula, param.values) ##<---- this is what I need } Where fitted.values is a vector of the same size as the x-values in user.formula. nls() does this somehow. I could do this easily myself if I have the user pass the formula in reverse polish notation, but I was hoping there was a more canonical was to do this in R. -- View this message in context: http://r.789695.n4.nabble.com/Model-Formulae-Evaluation-tp3610328p3611329.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.