[R] Plotting confidence intervals

Ben Tupper btupper @end|ng |rom b|ge|ow@org
Sun Dec 8 04:07:59 CET 2019


Hi,

Would something like yarrr do the trick?
https://ndphillips.github.io/yarrr.html

Or gghalves?  https://github.com/erocoar/gghalves


Cheers,
Ben

On Sat, Dec 7, 2019 at 9:32 PM <phil using philipsmith.ca> wrote:

> I want to show little bell curves on my bar chart to illustrate the
> confidence ranges. The following example from Paul Teetor's "R Cookbook"
> does what I want, but shows I-beams instead of bell curves. The I-beams
> suggest uniform, rather than normal distributions. So I am looking for a
> way to plot normal distribution curves instead.
>
> # Example from Paul Teetor, "R Cookbook", page 238.
> library(gplots)
> attach(airquality)
> heights <- tapply(Temp,Month,mean)
> lower <- tapply(Temp,Month,function(v) t.test(v)$conf.int[1])
> upper <- tapply(Temp,Month,function(v) t.test(v)$conf.int[2])
> barplot2(heights,plot.ci=TRUE,ci.l=lower,ci.u=upper,
>           ylim=c(50,90),xpd=FALSE,
>           main="Mean Temp. By Month",
>           names.arg=c("May","Jun","Jul","Aug","Sep"),
>           ylab="Temp (deg. F)")
>
> Does anyone know a package that does this or, alternatively, can anyone
> suggest a direction to go in if one were to write R code to do this?
>
> Philip
>
> ______________________________________________
> R-help using 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.
>


-- 
Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
http://www.bigelow.org/
https://eco.bigelow.org

	[[alternative HTML version deleted]]



More information about the R-help mailing list