Re: [R] Aliases for arguments in a function

From: Richard M. Heiberger <rmh_at_temple.edu>
Date: Tue 15 Aug 2006 - 22:39:40 EST


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)



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 15 22:44:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 16 Aug 2006 - 00:21:54 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.