Hi,Can I use "reorder" function with barchart as in dotchart? Here are
some
codes which do not work for me. Thanks
Chetty
___________________________
a1c.cast$bmi.cat.reordered[a1c.cast$eth!="Other"]
<-with(a1c.cast[a1c.cast$eth!="Other",],reorder(bmi.cat.ordered[a1c.cast$eth!="Other"],
BP.FN.RATE,median ))
barchart(BP.FN.RATE~
gender|eth,data=a1c.cast[a1c.cast$eth!="Other"&a1c.cast$bmi.cat.reordered!="Other",],
groups =bmi.cat.reordered ,
par.settings = list(superpose.polygon
list(col=c("blue","cyan","red","yellow"
)) ),
sub=" NHANES-99:06; n = 12,514 " ,ylab= list("Error Rate
(%)",cex=1.5),
xlab=list("Gender",cex=1.25),auto.key=list(title=" FPG VS A1C for
DM
Diagnosis: Missed BP",columns=2,cex=1.25),
col=c("blue","cyan","red","yellow"))
--
Chetty
Professor of Family Medicine
Boston University
Tel: 617-414-6221, Fax:617-414-3345
emails: chettyvk@gmail.com,vchetty@bu.edu
[[alternative HTML version deleted]]
Veerappa Chetty wrote:> > Hi,Can I use "reorder" function with barchart as in dotchart? Here are > some > codes which do not work for me. > .. example remove >As your example is not self-contained (it should be), I cannot show it with your data. My preferred way is to reorder outside, because it enforces consistency when I do several plots. Dieter library(lattice) barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), ylab = "Barley Yield (bushels/acre)", scales = list(x = list(abbreviate = TRUE, minlength = 5))) levels(barley$site) = c( "Waseca","Grand Rapids","Duluth","University Farm","Morris" , "Crookston" ) barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), ylab = "Barley Yield (bushels/acre)", scales = list(x = list(abbreviate = TRUE, minlength = 5))) -- View this message in context: http://www.nabble.com/Lattice-barchart-reordered-tp25865201p25867980.html Sent from the R help mailing list archive at Nabble.com.