On 10/16/06, Hans-Peter <[EMAIL PROTECTED]> wrote:
> 2006/10/16, Duncan Murdoch <[EMAIL PROTECTED]>:
> > As Gabor said, the third way is to give no default, but test missing()
> > in the code.
>
> I forgot this one, thank you. In my case it is probably not suited as
> I just pass the arguments to a C (Pascal) function and do the checking
> there.

The R interface need not be identical to the C or Pascal interface.
Its pretty easy to convert making use of the fact that a nonexistent
else leg returns NULL:

f <- function(x) { x <- if (!missing(x)) x; x }
f() # NULL

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

Reply via email to