[R] need means on all boxplots, but only half of them got that

arun smartpink111 at yahoo.com
Sun May 12 03:30:47 CEST 2013


Hi,
  If the means are based on the combination.
means<-tapply( Daten$weight, list(Daten$Dosis,Daten$sex), mean)
library(reshape2)

points(melt(means)$value,pch=5,col="red",lwd=5)
A.K.



----- Original Message -----
From: maggy yan <kiotoqq at gmail.com>
To: R-help at r-project.org
Cc: 
Sent: Saturday, May 11, 2013 8:57 PM
Subject: [R]  need means on all boxplots, but only half of them got that

I tried to draw a point on all boxplots for their means, I did:

boxplot( Daten$weight~interaction(Daten$Dosis,Daten$sex, drop=TRUE))
means<-tapply( Daten$weight, Daten$Dosis, mean)
points(means, pch=5, col="red", lwd=5)

but only the boxplots for male got that point on them, its really weird
because I don't think that I separated the sex in the codes above

    [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list