[R] barplot help needed

Antje niederlein-rstat at yahoo.de
Fri Nov 24 10:06:26 CET 2006


hello,

I would like to create the following barplot:

I have 4 different data sets (same length + stddev for each data point)

data1
sd1
data2
sd2
data3
sd3
data4
sd4

now, I'd like to plot in the following way:

data1[1],data2[1],data3[1],data4[1] with it's sd-values side-by-side at 
one x-axis label (named "position 1") and each bar in different colors.

data1[2],data2[2],data3[2],data4[2] at the next x-axis label (named 
"position 2") with the same color scheme

and so on over the whole length.

I managed to plot one set in the following way:

par(mai=c(1.5,1,1,0.6))
plotInfo <- barplot(data1, las=2, ylim = c(0,plotMax+1), ylab = 
"Percentage")
arrows(plotInfo,data1,plotInfo,  data1 + sd1, length=0.1, angle=90)
arrows(plotInfo,data1,plotInfo,  data1 - sd1, length=0.1, angle=90)

could anybody give me a help on this?

Antje



More information about the R-help mailing list