[R] plot xaxp issue
petr.pikal at precheza.cz
Tue Jan 8 08:36:37 CET 2013
I actually do not know what you are talking about. I believe that the code I provided works (if i did not make typing mistake), but you failed to provide data to test so I made my own data and subset inside lm works as expected.
fake<-data.frame(weight<-rnorm(15), length=weight*3+rnorm(15), sex=rep(c("b","g"), c(7,8)))
plot(fake$length, fake$weight, col=as.numeric(fake$sex))
bl<-lm(weight~length, data=fake, subset=sex=="b")
gl<-lm(weight~length, data=fake, subset=sex=="g")
Beware that R is smart but not smart enough to correct user typing mistakes (missing parntheses, missing commas, etc.). Typing mistakes are probably the most common source of failing code.
> -----Original Message-----
> From: Elaine Kuo [mailto:elaine.kuo.tw at gmail.com]
> Sent: Tuesday, January 08, 2013 2:03 AM
> To: PIKAL Petr
> Cc: r-help at r-project.org
> Subject: Re: [R] plot xaxp issue
> I figured out that the code should be
> boyline<-lm(body_weight ~ body_length, data=subset
> However, the "" could be omitted if the field name happened to be
> numeric, such as 1, 2, or 3.
> Please kindly explain why the "" could be omitted for numbers.
> Thanks again.
> On Tue, Jan 8, 2013 at 8:40 AM, Elaine Kuo <elaine.kuo.tw at gmail.com>
> > boyline<-lm(body_weight ~ body_length, data=together,
> > subset(together,sex=="boy"))
More information about the R-help