Skip to content
Prev 140620 / 398506 Next

adding bwplot to existing bwplot

On 3/27/08, Karin Lagesen <karin.lagesen at medisin.uio.no> wrote:
One simple option is to have a conditioning variable distinguishing
the two variables:

foo <-
    data.frame(x = gl(3, 1, 100),
               y1 = rnorm(100),
               y2 = runif(100))
bwplot(y1 + y2 ~ x, foo, outer = TRUE)


However, this will not put them side by side. To do that, you need to
reshape the data, e.g., with


foo2 <- reshape(foo, direction = "long",
                varying = c("y1", "y2"),
                v.names = "y")
bwplot(y ~ factor(time) | x, foo2, layout = c(3, 1))


-Deepayan