Among the many solutions, here is the one using phenology package: library("phenology")
plot_errbar(1:100, rnorm(100, 1, 2), xlab="axe x", ylab="axe y", bty="n", xlim=c(1,100), errbar.x=2, errbar.y=rnorm(100, 1, 0.1)) or x <- 1:100 plot_errbar(x=1:100, rnorm(100, 1, 2), xlab="axe x", ylab="axe y", bty="n", xlim=c(1,100), x.minus=x-2, x.plus=x+2) Sincerely Marc Girondot Le 12/08/13 15:41, Hedera a écrit : > Hello, > > I really need help, I am completely new in using R and many things were > possible to figure out but not my last problem. > I created a dotchart with the dotchart2 command. On the y axis are my 16 > groups and plotted is the mean of the data from each group. And now I want > to add the SD for every mean data point. Sure, I can calculate the SD (with > removing the NAs that are present in my data by na.rm=TRUE) but I don´t know > how to combine the graph with the SD. I found the arrows function but it > looks weird when I try to plot: > arrows(x0=m,y0=c(1:16),y1=c(1:16)-1,x1=m+1 length=0) -> "m" is the > calculated mean of my data with removed NAs and 167 because of the 16 > treatments > Has somebody please, please any (easy) suggestion how to do it? > > I hope to get some help. > Thank you very much for reading this. > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/help-with-adding-SD-to-graph-tp4673558.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. -- __________________________________________________________ Marc Girondot, Pr Laboratoire Ecologie, Systématique et Evolution Equipe de Conservation des Populations et des Communautés CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079 Bâtiment 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.giron...@u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot [[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.