[R] how to extract options for a function call

fisken torpedofisken at gmail.com
Mon Apr 18 15:56:56 CEST 2011

Hi, I'm having some difficulties formulating this question.

But what I want,
is to extract the options associated with a parameter for a function.

method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN")
in the optim function.

So I would like to have a vector with
c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN")

Or for instance the 'method' in the dist function can be supplied with
euclidian,maximum,manhatten, canberra,binary,minkowski.

Is there someway to extract this so I would have a vector with
c("euclidian","maximum","manhatten", "canberra","binary","minkowski").


More information about the R-help mailing list