
Last chance! 50% off unlimited learning
Sale ends in
dispersion(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA,
type="a",fill=NA,...)
dispbars(x,y,ulim,llim=ulim,intervals=TRUE,arrow.cap=0.01,arrow.gap=NA,...)
The intervals argument allows the user to pass the limits as either intervals (the default) or absolute values.
dispbars is now a call to dispersion with type set to a. If arrow.gap is greater than or equal to the upper or lower limit for a bar, segments is used to draw the upper and lower caps with no bars to avoid zero length arrows.
disptest<-matrix(rnorm(200),nrow=20)
disptest.means<-rowMeans(disptest)
row.order<-order(disptest.means)
se.disptest<-unlist(apply(disptest,1,std.error))
plot(disptest.means[row.order],main="Dispersion as error bars",
ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)),
xlab="Occasion",ylab="Value")
dispersion(1:20,disptest.means[row.order],se.disptest[row.order])
plot(disptest.means[row.order],main="Dispersion as confidence band",
ylim=c(min(disptest.means-se.disptest),max(disptest.means+se.disptest)),
xlab="Occasion",ylab="Value")
dispersion(1:20,disptest.means[row.order],se.disptest[row.order],type="l",
fill="#eeccee",lty=2)
# remember to redraw the points
points(disptest.means[row.order])
Run the code above in your browser using DataLab