For each X-value I calculated the average Y-value and the standard deviation (sd) of each Y-value
X
Y
sd
x = 1:5 y = c(1.1,
In addition to @csgillespie's answer, segments is also vectorised to help with this sort of thing:
segments
plot (x, y, ylim=c(0,6)) segments(x,y-sd,x,y+sd) epsilon <- 0.02 segments(x-epsilon,y-sd,x+epsilon,y-sd) segments(x-epsilon,y+sd,x+epsilon,y+sd)