Hi,

I'd like to follow up an older discussion on adding significance stars to
boxplots.
(
http://r.789695.n4.nabble.com/indicating-significant-differences-in-boxplots-td862335.html
)
As suggested by Jim Lemon, there is following solution for a single boxplot:

boxplot(count ~ spray, data = InsectSprays, col = "lightgray")

#and we'll assume that the second and third boxplots require a star:
par(xpd=TRUE)
yrange<-par("usr")[3:4]
ypos<-yrange[2]+diff(yrange)/40
segments(2,ypos,3,ypos)
text(2.5,ypos+diff(yrange)/40,"*",cex=2)
par(xpd=FALSE)

But what if one wants to plot two boxplots (e.g. with each only two groups
which are significantly different) and
add such stars to each of the boxplots. I usually use par(mfrow(1,2)) to
plot all boxplots in a row.
How can I also add segments and stars on top of each plot?

/johannes

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to