In R 3.0.2 the missing() function can tell us whether or not a formal parameter is missing.

How can one avoid hardcoding the variable name passed into missing? e.g. in

```
demoargs <- function(a=3, b=2, d) {
    f <- formals(demoargs)  # Capture formal arguments
    formalNames <- names(f) # get variable names: a, b, d
    ...   
}

```

I would like to be able to check for missing formals without doing this in a hardcoded manner, e.g.:

```
missing(formalNames[1])  # returns invalid use of missing!

```

as opposed to missing(d) for the purpose of iterating over a large number of optional arguments that are handled in a limited number of manners. I had hoped that get or as.name my put me on the right track but this does not seem to be the case.

Alternatively, I suspect that I could do this with the vararg arguments (...), but it would be nice for the caller to be able to inspect the acceptable optional arguments by examining the function declaration.

Thanks,
Marie