From p.dalgaard@biostat.ku.dk  Tue Aug 22 13:10:14 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 22 Aug 2000 14:10:14 +0200
Subject: [Rd] symbols: xlim and ylim cannot be specified (PR#639)
In-Reply-To: Uwe Ligges's message of "Tue, 22 Aug 2000 13:19:44 +0200"
References: <200008220700.JAA24625@pubhealth.ku.dk> <Pine.GSO.4.05.10008220841500.9118-100000@auk.stats> <14754.19553.429605.429987@gargle.gargle.HOWL> <39A261D0.4F731961@statistik.uni-dortmund.de>
Message-ID: <x2em3hfqe0.fsf@blueberry.kubism.ku.dk>

Uwe Ligges <ligges@statistik.uni-dortmund.de> writes:

> > I know.  Note however that to be really useful one would have to able to
> > also *set* missingness for an argument (which I think we can't currently)
> > 
> > I might want to call
> > 
> >         symbols(.very.long.argument.list.etc.etc.,
> >                 xlim = if(<something>) my.xlim else <<DEFAULT>>,
> >                 ...)
> > 
> > where with the NULL setup, I can even drop the else clause
> > {since  if(FALSE)  evaluates to NULL},
> > but with the   missing(xlim)  paradigm, I should be able to set <<DEFAULT>>
> > to missing...
> > 
> > In short, we (Uwe, people here and me) *do* prefer NULL to missing...
> 
> You are right.
...
> The only reason to use "missing" is the "standard paradigm" argument, as
> Prof. Ripley mentioned.

Also the fact that all those NULL defaults tend to clutter up the
code... 

I tend to see it the way that the "standard paradigm" is well
intended, but flawed -- mostly in the S incarnation, but also in R for
the reasons that Martin poins out. So another option could be to
fix things so that the paradigm worked.

Do we want to reconsider the semantics and include a "missing
constant"? In fact we have one (don't look now, Robert!):

missing.value<-quote()
missing(missing.value)
f<-function(x)missing(x)
f(missing.value)
y<-missing.value

However, things are not all that simple, e.g. constructions like

g<-function(y,x=if (y) 2 else missing.value) missing(x)

returns TRUE both for g(TRUE) and g(FALSE)

That actually makes sense, but this is perplexing:

> f<-function(x)missing(x)
> g<-function(y,x=if(y)2 else missing.value)f(x)
> g(F)
[1] FALSE
> g(T)
[1] FALSE
> g<-function(y,x=if(y)2 else missing.value)print(x)
> g(T)
[1] 2
> g(F)
Error in print(x) : Argument "missing.value" is missing, with no default

[You don't need to mess with missing.value to create this kind of
effect: 

> g<-function(y,x=y)f(x)
> g()
[1] TRUE
> g<-function(y,x=(y))f(x)
> g()
[1] FALSE

]

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] symbols: xlim and ylim cannot be specified (PR#639)
Peter Dalgaard BSA