formals {reflections} R Documentation

Access to and Manipulation of the Formal Arguments

Description


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.

Usage

formals(fun);

Arguments

fun

a Function, Or see 'Details’.

env

environment in which the function should be defined. [as Environment]

Details

Authors

SMRUCC genomics Institute

Value

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.

clr value class

Examples


[Package reflections version 2.33.856.6961 Index]