[R] barplot as Trellis graphic

Agustin Lobo Agustin.Lobo at ija.csic.es
Wed Mar 26 22:24:04 CET 2008


Dear list,

Is there any way of making barplots as a Trellis graphic?
Currently I do something like:

class <- unique(mydata[,1])
par(mfrow=c(3,3))
for(i in class){
  sel <- mydata[mydata[,1]==i,]
  barplot(sel)
  title(i)
}

where class would take values between 1 and 9
and the first column of mydata would be the class.

But I'm looking for a nicer code and a nicer graphic
using the approach of the lattice package.

Thanks!

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster



More information about the R-help mailing list