Skip to content
Prev 46240 / 63458 Next

On the mechanics of function evaluation and argument matching

Thanks for the lead. Given the example in ?missing though, wouldn't it be safer to explicitly define a default value of NULL:

myplot <- function(x, y=NULL) {
  if(is.null(y)) {
    y <- x
    x <- 1:length(y)
  }
  plot(x, y)
}
On Jul 17, 2013, at 11:05 AM, "R. Michael Weylandt" <michael.weylandt at gmail.com> wrote: