Learn R Programming

rando (version 0.2.0)

extract_dots: Extract the ellipsis inside a function

Description

Allow the named entries in ... to be used easily within a function by attaching them to the function's environment

Usage

extract_dots()

Arguments

Value

No return value, called for it's side effect

Examples

Run this code
# NOT RUN {
f <- function(...) {
  a + b
}

# }
# NOT RUN {
# Throws an error because a and b are trapped inside `...`
 f(a = 1, b = 2)
# }
# NOT RUN {
f <- function(...) {
  extract_dots()
  a + b
}
f(a = 1, b = 2)

# }

Run the code above in your browser using DataLab