0
我有一個用格的xyplot生成的線條圖。它包含兩種測量的溫度類型,其中一種是平均值。因此,我想向這些點添加標準錯誤(t.tort)。在格線圖中分別添加誤差條?
xyplot(mean.tort+t.ws~DateTime, pre, type=c("a", "p"), col=c("red", "blue"),
main="Pre-Translocation",
xlab=list(label="Date and Time", cex=1),
ylab=list(label="Temperature (°C)", cex=1),
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)))
errbar(x=pre$DateTime, y=pre$mean.tort, yplus=pre$mean.tort+pre$se.tort,yminus=pre$mean.tort-pre$se.tort,
add=T, col="red")
我的數據幀的重要位如下:不幸的是,單獨執行該操作不使用(Hmisc)errbar ......這裏是我想出了工作至今:
pre$DateTime<-c(as.POSIXct("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")
pre$t.ws<-c(32.7, 35.5, 37.1, 37.6, 38.7)
pre$mean.tort<-c(32.4, 34.9, 35.1, 36.8, 37.7)
pre$se.tort<-c(0.825, 0.84, 0.21, 0.228, 0.28)
我對此感到有點沮喪,所以任何建議都會被大大地塗抹。 非常感謝您的努力!
你不能混合基礎和網格圖形。你環顧四周嗎? http://stackoverflow.com/questions/2381618/how-to-draw-a-chart-with-sorted-horizontal-error-bars-sorted-barcharts-with-err –