[R] gap.barplot with means and standard error bars

Jim Lemon drjimlemon at gmail.com
Fri Apr 28 13:25:58 CEST 2017


Hi Bianca,
Try this:

gap.barplot(c(mean(SA),mean(AA),mean(CA)),
 gap=c(1,250),xlim=c(0.5,3.5),xaxlab=c("SA","AA","CA"),
 ytics=c(0,255,260,265),yaxlab=c(0,255,260,265))
barlabels(1:3,c(5,5,5),
 paste(c(mean(SA),mean(AA),mean(CA)),
 round(c(sd(SA),sd(AA),sd(CA)),3)))

It's a bit rough, but I don't have time for refinement tonight.

Jim

On Fri, Apr 28, 2017 at 5:10 AM, Biank M <bianca12_domi at hotmail.com> wrote:
> Hi..
>
>
> I've been trying to create a barplot with the following data:
>
>
> SA<- c(0.06, 0.061, 0.06, 0.06, 0.06)
> AA<- c(0.29, 0.275, 0.271, 0.274, 0.276)
> CA<- c(266.783, 257.726, 276.331, 268.859, 265.042)
>
>
> I want a bar for "SA", a bar for "AA", and a bar for "CA" (x- axis). The height of the bar must be represented by the mean of each vector data and include SE bars. Since there are very very large differences in numbers , I want to add a gap between 1 and 250 (y-axis).
>
>
> I know that the gap.barplot function is used to produce the gap, but I don't know how to include the means and SE bars.
>
> Can you help me creating this plot??
>
>
> Thank you very much!!
>
>
> Greetings,
>
> Bianca
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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