On Jan 7, 2013, at 5:02 PM, Elaine Kuo wrote:
Hello,
I figured out that the code should be
boyline<-lm(body_weight ~ body_length, data=subset
(together,,sex=="boy"))
However, the "" could be omitted if the field name happened to be
numeric, such as 1, 2, or 3.
Please kindly explain why th
com]
> Sent: Tuesday, January 08, 2013 2:03 AM
> To: PIKAL Petr
> Cc: r-help@r-project.org
> Subject: Re: [R] plot xaxp issue
>
> Hello,
>
> I figured out that the code should be
>
> boyline<-lm(body_weight ~ body_length, data=subset
> (together,,sex=="boy&q
Hello,
I figured out that the code should be
boyline<-lm(body_weight ~ body_length, data=subset (together,,sex=="boy"))
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.
Ela
Hello,
Thanks again.
But something wrong with the subset after lm
>
> It is not about drawing plot many times but coding points or graphic objects
> by some factor. In your case sex.
>
> Instead of
> boyline<-lm(body_weight ~ body_length, boy)
>
> use collective data frame together and subset on
Hi
> -Original Message-
> From: Elaine Kuo [mailto:elaine.kuo...@gmail.com]
> Sent: Monday, January 07, 2013 1:45 PM
> To: PIKAL Petr
> Cc: r-help@r-project.org
> Subject: Re: [R] plot xaxp issue
>
> Thank you Petr, the code is wonderful.
>
> One more qu
Thank you Petr, the code is wonderful.
One more question,
you used [as.numeric(together$sex)] to drawing plots many times (Par(new)).
Please kindly advise if there is a similar method to replace drawing
ablines many times.
If not, I am afraid that the ablines will not follow the same Y and
X-axis
Thanks a lot.
Please kindly indicate the meaning of the c(8,7).
> together <- rbind(boy, girl)
> together$sex <- factor(rep(c("boy", "girl"), c(8,7)))
Elaine
On Mon, Jan 7, 2013 at 4:55 PM, PIKAL Petr wrote:
> Hi
>
> Instead of two plots with par(new = TRUE) try to put boys and girls together
Hi
Instead of two plots with par(new = TRUE) try to put boys and girls together
(quite natural thing, they will be pleased 8-)
together <- rbind(boy, girl)
together$sex <- factor(rep(c("boy", "girl"), c(8,7)))
plot(together$body_length, together$body_weight, ,
col=c("firebrick3","saddlebro
8 matches
Mail list logo