Learn R Programming

boostr (version 1.0.0)

addDots: Extend a function's signature to include '...'

Description

modifies the input function to accept extra arguments, if it doesn't already.

Usage

addDots(func, .verbose = FALSE)

Arguments

func
the function whose signature is to be modified.
.verbose
logical flag indicating whether warnings should be displayed or not.

Value

a function with the same body as func but whose signature now includes ....

Examples

Run this code
## Not run: 
# f <- function(x,y) x^2 + y^2
# 
# g <- addDots(f)
# g
# 
# h <- addDots(g, .verbose=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab