[R] Aliases for arguments in a function

Richard M. Heiberger rmh at temple.edu
Tue Aug 15 14:39:40 CEST 2006


foo <- function(arg1, this, that) {
  if (missing(this) && !missing(that)) this <- that
  if(this < 0) stop("this must be positive")
  return(arg1/this)
}

foo(arg1=5, this=10)

foo(arg1=5, that=10)



More information about the R-help mailing list