Skip to content
Prev 201858 / 398506 Next

lattice --- different properties of lines corresponding to type=c("l", "a") respectively

On Fri, Nov 27, 2009 at 1:13 AM, Kjetil Halvorsen
<kjetilbrinchmannhalvorsen at gmail.com> wrote:
Are you looking for per-group average or overall average? All your
attempts will do per-group average, which is rather pointless here.
For a global average you need to call panel.average with all the data,
not through panel.superpose:

mypanel <- function(x, y, ..., groups, type){
    panel.xyplot(x, y, ..., groups = groups, type=type)
    panel.average(x, y, horizontal = FALSE,
                  col = "black", lwd = 3)
}

xyplot(response ~ time|group, repa0, groups=~Participant, type="l",
       ylim=c(0, 10), panel=mypanel)


-Deepayan