Re: [R] Error in plot.lm

2011-03-11 Thread Peter Ehlers
On 2011-03-11 13:33, Jeff Newmiller wrote: Thank you for indicating more precisely where the bug arises. I disagree with the blanket assertion that the I() is not needed. The example is purposely simplified to illustrate the problem, which lm has no difficulty with but which plot.lm does. plot.l

Re: [R] Error in plot.lm

2011-03-11 Thread peter dalgaard
On Mar 11, 2011, at 20:31 , David Winsemius wrote: > > Are you sure you need I() on the LHS? The I function is designed to avoid the > confusion related to the dual use of the arithmetic operator symbols > affecting the construction of the model matrix, but I don't think that > applies to th

Re: [R] Error in plot.lm

2011-03-11 Thread Jeff Newmiller
Thank you for indicating more precisely where the bug arises. I disagree with the blanket assertion that the I() is not needed. The example is purposely simplified to illustrate the problem, which lm has no difficulty with but which plot.lm does. plot.lm manages to deal with I() on the right si

Re: [R] Error in plot.lm

2011-03-11 Thread Peter Ehlers
On 2011-03-11 11:31, David Winsemius wrote: On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote: > I am encountering an error with plot.lm: > >> tstdf<- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) >> plot(lm(I(y) ~ x, data=tstdf)) > Hit to see next plot: > Hit to see next plot: >

Re: [R] Error in plot.lm

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote: I am encountering an error with plot.lm: tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) plot(lm(I(y) ~ x, data=tstdf)) Hit to see next plot: Hit to see next plot: Error in object$coefficients : $ operator is invalid for atomic

[R] Error in plot.lm

2011-03-11 Thread Jeff Newmiller
I am encountering an error with plot.lm: tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) plot(lm(I(y) ~ x, data=tstdf)) Hit to see next plot: Hit to see next plot: Error in object$coefficients : $ operator is invalid for atomic vectors Obviously I don't need the I() in this examp