formals {reflections} | R Documentation |
Get or set the formal arguments of a function.
For the first form, fun can also be a character string naming
the function to be manipulated, which is searched for from the
parent frame. If it is not specified, the function calling
formals is used.
Only closures have formals, Not primitive functions.
formals(fun);
formals returns the formal argument list of the function specified, as a pairlist, or NULL for a non-function or primitive. The replacement form sets the formals Of a Function To the list/pairlist On the right hand side, And (potentially) resets the environment Of the Function.