[R] barplot as Trellis graphic (corrected)

From: Agustin Lobo <Agustin.Lobo_at_ija.csic.es>
Date: Wed, 26 Mar 2008 22:51:29 +0100


In the code of my previous message
the barplot should be:
barplot(apply(sel[,-1],2,mean))
instead of
barplot(sel)

Sorry for the confusion.

Agus

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

--

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

--

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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 26 Mar 2008 - 22:11:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Mar 2008 - 22:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive