I would like to add an error bar of 1.555 % to each data point. Or have a back ground band of +/- 1.555 behind the points. I've done the calculation elsewhere based on a different set which is not featured in the plot. I can't seem to add this vertical error bar.
library(ggplot2)
carb<-read.table("total_carb", header= TRUE)
p<- ggplot(carb,aes(x=Sample, y=TC, color="Total Carbonate")) + geom_line() + geom_point()
p + scale_x_continuous(name="Core Depth (cm)") + scale_y_continuous(name="Carbonate (%)")
+ geom_errorbar(aes(ymin=TC-1.555, ymax=TC+1.555), width=.2)
my error:
Error in +geom_errorbar(aes(ymin = TC - 1.555, ymax = TC + 1.555), width = 0.2) : invalid argument to unary operator
+
sign at the beginning of thegeom_errobar
line rather than the end of the previous line. See here. I believe this error message is changing in the next release of ggplot2 in an attempt to make what is happening clearer. – aosmith