[R] Finishing details of dotplot

John Poulsen jpoulsen at zoo.ufl.edu
Tue Aug 12 18:56:34 CEST 2008


Hello,

I am trying to create a dotplot, and have run into a couple of snags 
with the finishing details.  The below code creates the dotplot, but I 
cannot figure out how to: 1) change the color of the CI bars to black, 
not blue, 2) delete the horizontal dotplot lines, and 3) arrange the 
parameters in the order that they are listed in the par vector below, 
rather than having them be arranged alphabetically.

Thanks for any help you can give.

Cheers,
John



e.test=c(0.42, -0.39, 0.16, 0.15, 0.58, 0.32, 0.55, 0.12, -0.14, -0.44, 
0.15, 0.16, 1.2, 1.34, 0.42, 1.02)
sd.test=c(0.023, 0.053, 0.109, 0.109, 0.047, 0.038, 0.04, 0.035, 0.054, 
0.141, 0.086, 0.085, 0.131, 0.114, 0.131, 0.111)
lower=e.test - (sd.test * 1.96)
upper=e.test + (sd.test * 1.96)
spp=rep(c("D", "M"), each=8)
par=rep(c("Ind","For","LR","SR","Lnd","Nd1","Nd2","Pkl"),2)
res=data.frame(e.test,sd.test,lower,upper,spp,par)


Dotplot(par~Cbind(e.test, lower, upper)|spp, data=res,
          pch=16, col="black", method="bars",
          ylab="Parameters", xlab="Estimate",
          panel=function(x,y){
           panel.Dotplot(x, y, col="black",
             panel.abline(v=1, lty=2))},
          strip=strip.custom(style=1, bg="lightgrey"))



More information about the R-help mailing list