Re: [R] Aliases for arguments in a function

2006-08-15 Thread Prof Brian Ripley
foo <- function(arg1, this=that, that) ... works. On Tue, 15 Aug 2006, [EMAIL PROTECTED] wrote: > Hi all. > > I have a function that I would like to use either the argument name as > originally defined or another name. Within the function (and other functions) > use the argument name as orig

Re: [R] Aliases for arguments in a function

2006-08-15 Thread Richard M. Heiberger
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.e

[R] Aliases for arguments in a function

2006-08-15 Thread [EMAIL PROTECTED]
Hi all. I have a function that I would like to use either the argument name as originally defined or another name. Within the function (and other functions) use the argument name as originally written, so I don't want to simply remove the old argument name for the new one, but simply allow the

Re: [R] "aliases" for R constructs?

2003-10-22 Thread Thomas Lumley
On Wed, 22 Oct 2003, Patrick Burns wrote: > > > Simon Fear wrote: > > > > >3. I have a very old brown-covered book describing macros in > >the S language (version 1? I don't have it to hand to check). > >When and why did they disappear? (Hoping John Chambers > >is reading this.) > > > > > Pretty m

Re: [R] "aliases" for R constructs?

2003-10-22 Thread Patrick Burns
Simon Fear wrote: 3. I have a very old brown-covered book describing macros in the S language (version 1? I don't have it to hand to check). When and why did they disappear? (Hoping John Chambers is reading this.) Pretty much the same reason that you don't grind your flour by hand with a st

RE: [R] "aliases" for R constructs?

2003-10-22 Thread Simon Fear
to hand to check). When and why did they disappear? (Hoping John Chambers is reading this.) > -Original Message- > From: Thomas Lumley [mailto:[EMAIL PROTECTED] > Sent: 20 October 2003 23:03 > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [R] "aliases" fo

[R] aliases

2003-10-20 Thread Gabor Grothendieck
How about: nis.na <- complete.cases --- From: <[EMAIL PROTECTED]> Hi Folks, My recent response to Laura Quinn's query about matrix subsetting reminded of a question. I wrote: iDir <- ((Winds[,20]<45)|(Winds[,20]>315))&(!is.na(Winds[,20])) Now, I find "!is.na" a bit awkward to type, so

Re: [R] "aliases" for R constructs?

2003-10-20 Thread Thomas Lumley
On Mon, 20 Oct 2003 [EMAIL PROTECTED] wrote: > Hi Folks, > > My recent response to Laura Quinn's query about matrix subsetting > reminded of a question. > > I wrote: > > iDir <- ((Winds[,20]<45)|(Winds[,20]>315))&(!is.na(Winds[,20])) > > Now, I find "!is.na" a bit awkward to type, so I might pre

[R] "aliases" for R constructs?

2003-10-20 Thread Ted Harding
Hi Folks, My recent response to Laura Quinn's query about matrix subsetting reminded of a question. I wrote: iDir <- ((Winds[,20]<45)|(Winds[,20]>315))&(!is.na(Winds[,20])) Now, I find "!is.na" a bit awkward to type, so I might prefer to type it as "nis.na". While it is possible to define