Is it possible to change the default values of formal parameters in an R function at runtime?
Let\'s assume, we have the function
f <- function(x=1) {
An alternative (shown in a different SO post) is to use the formals function, e.g.:
formals
formals(f) <- 2