[ top | up ]

Access to the Formal Arguments

Syntax

formals(fun=sys.function(sys.parent()))

Value

If fun is a function then the formal argument list to that function is returned. If fun is a character string then the function with that name is found and used. If fun is not specified then the function calling formals is used.

It is currently not possible to set the formals of a function.

See Also

args

Examples

length(formals(lm)) # the number of formal arguments names(formals(boxplot)) # formal arguments names