Skip to content

bwplot superpose panel.points from another dataframe

6 messages · Peter Ehlers, Dennis Murphy, Deepayan Sarkar +1 more

#
On 2010-09-27 4:54, Christophe Bouffioux wrote:
Perhaps this is what you're trying to achieve:

  bwplot(v2 ~ v1 | z, data = ex3, layout=c(3,2),
        panel = function(x, y){
             panel.bwplot(x, y, pch="|")
             X <- tapply(ex3$v1b, ex3[, 1:2], max)
             Y <- seq(nrow(unique(ex3[, 1:2])))
             panel.points(X, Y, pch = 17, col = "red")
             })

(I didn't see any need for your par.settings.)

I'm not crazy about the way you define X,Y. I think
I would augment the data frame appropriately instead.

   -Peter Ehlers
#
On Tue, Sep 28, 2010 at 12:59 PM, Christophe Bouffioux
<christophe.b00 at gmail.com> wrote:
You are probably looking for something like these:

bwplot(v2 ~ v1 | z, data = ex3, layout=c(3,2), X = ex3$v1b,
       pch = "|",
       panel = function(x, y, ..., X, subscripts){
           panel.bwplot(x, y, ..., subscripts = subscripts)
           X <- X[subscripts]
           X <- tapply(X, y, unique)
           Y <- tapply(y, y, unique)
           panel.points(X, Y, pch = 17, col = "red")
       })


bwplot(v2 ~ v1 | z, data = ex, layout=c(3,2), ext.data = ex2,
       pch = "|",
       panel = function(x, y, ..., ext.data){
           panel.bwplot(x, y, ...)
           i <- which.packet()
           sub <- subset(ext.data, as.numeric(z) == i)
           with(sub, panel.points(v1b, v2, pch = 17, col = "red"))
       })

-Deepayan