[Rd] lm, weights and ...

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sun 03 Sep 2006 - 15:46:02 GMT

> lm2 <- function(...) lm(...)
> lm2(mpg ~ wt, data=mtcars)

lm(formula = ..1, data = ..2)


(Intercept)           wt
     37.285       -5.344

> lm2(mpg ~ wt, weights=cyl, data=mtcars)
Error in eval(expr, envir, enclos) : ..2 used in an incorrect context, no ... to look in

Can anyone explain why this is happening? (Obviously this is a manufactured example, but it crops up in ggplot when you want to provide a function to perform smoothing)



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Sep 04 02:58:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 06 Sep 2006 - 11:39:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.