Re: [R] barplot as Trellis graphic

From: Agustin Lobo <Agustin.Lobo_at_ija.csic.es>
Date: Thu, 27 Mar 2008 18:47:04 +0100

Thanks, it was a matter of reshaping the data matrix as I usually have it, ie:
datos <-
data.frame(x=abs(round(rnorm(100,10,5))),y=abs(round(rnorm(100,2,1))),f=factor(round(runif(100,1,3))))

to become:

datos2 <-
data.frame(V1=c(datos[,1],datos[,2]),"VAR"=c(rep("x",100),rep("y",100)),f=factor(c(datos[,3],datos[,3])))

and then
require(lattice)
barchart(V1~VAR|f,data=datos2)

I get horizontal lines in the bars that I do not understand, though.

Agus

Deepayan Sarkar escribió:
> On 3/26/08, Agustin Lobo <Agustin.Lobo@ija.csic.es> wrote:

>> Dear list,
>>
>>  Is there any way of making barplots as a Trellis graphic?

>
> Yes, the function to use is 'barchart'.
>
> -Deepayan
>
-- 
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 Thu 27 Mar 2008 - 21:56:55 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 Fri 28 Mar 2008 - 15:30:25 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