[R] barchart in lattice

Deepayan Sarkar deepayan at stat.wisc.edu
Sun Nov 2 17:34:10 CET 2003

On Sunday 02 November 2003 04:17, Bernd Weiss wrote:
> Dear all,
> I have two factors 'country' and 'status' which I would like to plot via
> barchart (lattice). 'status' consist of three different levels and should
> be the grouping variable, 

the correct terminology would be 'conditioning' variable. Grouping variables 
distinguish data within a panel.

> i.e. there should be drawn three different panels
> and within each panel a barchart of 'country'.

I'm not sure what that means. If you mean barchart of the frequency of 
occurrence of each country within each 'status', then you could try 

foo <- read.table("meta.txt")
barchart(daten.COUNTRY ~ Freq| daten.STATUS, 
         data = as.data.frame(table(foo)), 
         origin = 0)


> barchart(daten$COUNTRY|daten$STATUS),
> barchart(table(daten$COUNTRY)|table(daten$STATUS)),
> etc. are obviously wrong.
> I have absolutely no idea how to do this.
> You can download the datafile from
> <http://www.uni-koeln.de/~ahf34/meta.txt>
> TIA,
> Bernd

More information about the R-help mailing list