Skip to content

Grouped bwplots?

3 messages · Fredrik Karlsson, Deepayan Sarkar, Hadley Wickham

#
Dear list,

I am sorry for asking you this, but I am trying to do again what I
thought I have done before, although this time it does not work.

So, given the data set:
I would like to do:
where the groups argument makes a difference (as in dividing each box
into two by group).
Is this possible to do? If so, what I am doing wrong?


/Fredrik
#
On 2/20/09, Fredrik Karlsson <dargosch at gmail.com> wrote:
Here's a start:

bwplot(d ~ xfak | panfak,data=testdf, groups= grfak,
       panel = panel.superpose,
       panel.groups = panel.bwplot,
       fill = "transparent")

You will probably want to write a custom panel.groups function to get
more control over graphical parameters.

-Deepayan
#
On Fri, Feb 20, 2009 at 3:57 PM, Fredrik Karlsson <dargosch at gmail.com> wrote:
An alternative approach is to use ggplot2:

install.packages("ggplot2")
library(ggplot2)
qplot(xfak, d, data=testdf, facets = ~panfak, fill = grfak, geom="boxplot")

Hadley