[R] several boxplots or bwplots into one graphic

Petr Pikal petr.pikal at precheza.cz
Tue Jan 25 07:47:38 CET 2005



On 24 Jan 2005 at 14:44, Christoph Lehmann wrote:

> Hi
> I have 10 variables and 2 groups. I know how to plot a bwplot for ONE
> var. e.g.
> 
> var.a var.b var.c .. GROUP
> 0.2   0.5   0.2   .. 0
> 0.3   0.2   0.2   .. 0
> ..
> 0.1   0.8   0.7   .. 1
> 0.5   0.5   0.1   .. 1
> ..
> 
> 
> bwplot(var.a ~ GROUP, data = my.data)
> 
> How can I plot 10 bwplots (or boxplots) automatically into one
> graphic? is there any function from lattice which can do this?

Hallo

It probably depends on how you want to organise your boxplots. You 
can reformat your table to long format to get second grouping 
(a,b,...) by reshape (or reShape from Hmisc) and than use interaction 
and boxplot or bwplot(Group~var|second.grouping)

Cheers
Petr


> 
> thanks for a short hint
> 
> christoph
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz




More information about the R-help mailing list