The 'modifyList' function on package Utils allows to do that in a very compact way:
do.call("optim", modifyList(list(<your default values>), list(...))) Regards, Enrique Mathieu Ribatet wrote: > Dear all, > > I'd like tweaking the ... arguments that one user can pass in my > function for fitting a model. More precisely, my objective function is > (really) problematic to optimize using the "optim" function. > Consequently, I'd like to add in the "control" argument of the latter > function a "ndeps = rep(something, #par)" and/or "parscale = something" > if the user has not specified it already. > > Do you know a way to deal with this point? > In advance, thanks. > > Mathieu ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel