Collects all function arguments other than the first into a single list parameter.
collect_fn_params.RdUseful for converting a regular function into a function amenable to
optimization via stats::optim, which requires all free parameters be
passed as a single vector par.
Arguments
- fn
- functionA non-primitive function to refactor such that the first argument becomes the second argument and all other parameters must be passed as a vector to the first argument of the new function via the- parparameter.