[R] Need help with boxplots

Gabor Grothendieck ggrothendieck at gmail.com
Tue Sep 26 12:45:47 CEST 2006


To prevent confusion you might want to use a red dot rather than
a line:

   points(1:2, c(mean(a), mean(b)), col = "red")

and perhaps label it since its non-standard:

   text(1:2, c(mean(a), mean(b)), "Mean", pos = 4)

On 9/26/06, laba diena <juscio at gmail.com> wrote:
> How to add a mean line in the boxplot keeping the median line ?
> For example in this:
>
>
> set.seed(1)
>
> a <- rnorm(10)
>
> b <- rnorm(10)
>
> boxplot(a, b)
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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