Skip to contents

This function returns the names of function arguments.

Usage

function_arguments(f, with_default = TRUE, with_ellipsis = TRUE)

Arguments

f

[function]
A function.

with_default

[logical(1)]
Include function arguments that have default values?

with_ellipsis

[logical(1)]
Include the "..." argument if present?

Value

A character vector.

See also

Examples

f <- function(a, b = 1, c = "", ...) { }
function_arguments(f)
#> [1] "a"   "b"   "c"   "..."
function_arguments(f, with_default = FALSE)
#> [1] "a"   "..."
function_arguments(f, with_ellipsis = FALSE)
#> [1] "a" "b" "c"