[R] Bug or failing understanding?

kjetil halvorsen kjetilh at umsanet.edu.bo
Wed Jun 26 17:46:31 CEST 2002


Hola!

I seem to remember i used to have the same name of argument and default
value in argument list to functions, but (rw1.5.1) this seems not to
work:

> x <- 3
> test <- function(x=x) x*x
> test(7)
[1] 49
> test()
Error in test() : recursive default argument reference


here is a code fragment from lm() using the same syntax:


 else {
        x <- model.matrix(mt, mf, contrasts)
        z <- if (is.null(w)) 
            lm.fit(x, y, offset = offset, ...)
        else lm.wfit(x, y, w, offset = offset, ...)

What is wrong?

Kjetil Halvorsen
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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