[R] "formula plotting" -> substitute pecularity

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Dec 15 00:02:27 CET 1999


Martin Maechler <maechler at stat.math.ethz.ch> writes:

> This is something between a question and a bug report.
>      {sometimes one should first ask on R-help before sending to R-bugs....}
..
> ## This ``should'' work, but does not :
> 
>  e2 <- substitute(T(x[1],...,x[n])*",  "*N[1] == n1, list(n1=nn))
> 
>  ##>>  Error: ... used in an incorrect context

I think that is a bug. Simplest variant:

> substitute(a(...))
Error: ... used in an incorrect context

I think the basic issue is that when you use ... in a function,
substitute will try to match it against the actual parameter list,
e.g.

> f<-function(...)substitute(a(...))
> f(2)
a(2)
> f(2,3,4)
a(2, 3, 4)

However, when there's no ... argument to f, substitute will complain,
as would any other function trying to handle ... but the semantics of
substitute should be different.

Robert?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list