[Rd] bug in dummy.coef.lm? (PR#1048)

adrian@maths.uwa.edu.au adrian@maths.uwa.edu.au
Fri, 10 Aug 2001 10:24:05 +0200 (MET DST)


Hi - 
I'm running R 1.3.0 on i686-pc-linux-gnu

	> rm(x, y, z)
	> df <- data.frame(x=1:20,y=1:20,z=factor(1:20 <= 10))

dummy.coef falls over:

	> dummy.coef.lm(lm(y ~ z * poly(x,1), data=df))
	Error in poly(x, 1): Object "x" not found
	> dummy.coef.lm(lm(y ~ z * I(x), data=df))
	Error in unique(c("AsIs", class(x))): Object "x" not found

but works OK with:
	> dummy.coef.lm(lm(y ~ z * x, data=df))
	> dummy.coef.lm(lm(y ~ poly(x,1), data=df))
	> dummy.coef.lm(lm(y ~ I(x), data=df))
	
	> x <- df$x
	> y <- df$y
	> z <- df$z
	> dummy.coef.lm(lm(y ~ z * poly(x,1)))
	> dummy.coef.lm(lm(y ~ z * I(x)))

cheers
----
Adrian Baddeley, Mathematics & Statistics, University of Western Australia
		<http://maths.uwa.edu.au/~adrian/>



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