Skip to content
Prev 384492 / 398498 Next

chaining closure arguments on-the-fly

Hi Ben,

How about something like this:

f <- function(x, y = NULL) {

  if (is.null(y)) 
    y <- x

  x + y
}
[1] 7
[1] 6

Regards,

Marc Schwartz