Try this
Your data:
pre = data.frame(DateTime = as.POSIXct(c("2013-01-27 09:00:00", "2013-01-27 10:00:00",
"2013-01-27 11:00:00", "2013-01-27 12:00:00",
"2013-01-27 13:00:00")),
t.ws = c(32.7, 35.5, 37.1, 37.6, 38.7),
mean.tort = c(32.4, 34.9, 35.1, 36.8, 37.7),
se.tort = c(0.825, 0.84, 0.21, 0.228, 0.28))
The plot:
require(lattice)
xyplot(mean.tort+t.ws~DateTime, pre,
main="Pre-Translocation",
xlab=list(label="Date and Time"),
ylab=list(label="Temperature (°C)"),
scales = list(tck = c(1, 0),
x=list(cex=0.8, rot=45, tick.number=40),
y=list(cex=0.8, tick.number=8, limits=c(29,43))),
key=list(text=list(c("Tortoise","Ambient")),
lines=list(col=c("red", "blue"),
type="l"), corner=c(0.5,0.92)),
lx = pre$mean.tort - pre$se.tort, ux = pre$mean.tort + pre$se.tort,
panel = function (x,y, lx, ux, ...){
panel.xyplot(x,y, type = "b", col=c("red", "blue"), ...)
panel.segments(x0 = x, x1 = x, y0 = lx, y1 = ux, col = "red", ...)
}
)
Here you go:
You can use panel.arrows()
instead of the segments if you really want to put those little 'hats' on your error bars.