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
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
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
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
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
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
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
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
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