Skip to contents

This function retrieves the source code of a function's definition by simply wrapping attr(fun, "srcref") to pull the "source reference" attribute of the function.

This is more useful than simply printing the function definition by excluding () because it provides the actual source code (and comments, formatting, etc.) of the function definition.

Usage

get_function_definition(fun)

Arguments

fun

An R function

Value

The source code of the function's definition.

See also

Examples

get_function_definition(print)
#> NULL