get_dots: Resolve Triple-Dot (...) Argument inside Function Body

Description Usage Arguments Value Examples

View source: R/function.R

Description

Breaks up a triple-dot (...) argument of a function call into more accessible objects.

Usage

1
get_dots(..., evaluate = FALSE)

Arguments

...

A ... argument composed of all non-formal arguments of a function call, where ... must be a formal parameter of the function.

evaluate

Logical: return ... object not only as a list of symbols, but also a list of those symbols expanded by eval().

Value

A list of objects mostly related to the non-formal arguments of a function call:

calling_function

The name (if available) of the calling function.

current_function

The name (if available) of the current function.

current_formals

A character vector of the names of the formal parameters of the current function.

arguments

A list of objects, as symbols, contained in ..., with named elements for named arguments.

evaluated

A list of objects contained in ..., with named elements for named arguments.

as_character

The objects contained in ... coerced into a character vector, with named elements for named arguments.

named_dots

The names of the arguments contained in ..., with blank strings for unnamed arguments.

all_named_args

All named arguments of the function call, including formal arguments.

Examples

1
2
3
4
x <- function(a, b, ...) browser()
x(a=666, fish="trout", frog=10, bob=3.14, TRUE, "ouch", FALSE)
dots <- get_dots(...)
dots

priscian/jjmisc documentation built on June 23, 2021, 2:12 p.m.