[R] several boxplots or bwplots into one graphic

Deepayan Sarkar deepayan at stat.wisc.edu
Tue Jan 25 16:14:37 CET 2005


On Tuesday 25 January 2005 03:42, Christoph Lehmann wrote:
> many thanks for your great tip. I didn't know reshape.
>
> Unfortunately in my real data, the values of my variables are ont all
> within the same range. Therefore, what shall I change in the code to
> get for each plot a scale, which is adjusted to the range of my
> variable?

With bwplot, something like

bwplot(factor(GROUP) ~ var.a + var.b + var.c, mydata, 
       outer = TRUE, scales = list(x = "free"))

or

bwplot(var.a + var.b + var.c ~ factor(GROUP), mydata, 
       outer = TRUE, scales = list(y = "free"))

may get you what you want. This does the 'reshape'-ing 
automagically ;-), and the same idea (scales="free") can be used with 
reshaped data as well.

Deepayan




More information about the R-help mailing list