Hi,
I'm wondering if there is a programmatic way to create a new function that has the same arguments as another function. Let's say I wanted to create a function with the same arguments as lm()
Something like:
args <- as.list(names(formals(lm)))
foo <- function(!!!args) {
# body
}
The code above doesn't work, but I'm wondering if there is a way to do this.