On 7/11/07, Jonathan Williams <[EMAIL PROTECTED]> wrote:
> Deepayan,
>
> Thanks for the clarification.  The rectangles are completely external
> to the panel data, and correspond to 90% confidence intervals built
> from training data, to be overlaid on these graphs of the test data.

Right. So if you have that information in a single object (say a
list), you can specify that as an argument to xyplot (or whatever),
and capture that in the panel function to then index it. E.g.


rectInfo <-
    list(matrix(runif(4), 2, 2),
         matrix(runif(4), 2, 2),
         matrix(runif(4), 2, 2))


panel.qrect <-
    function(x, y, ..., rect.info)
{
    ri <- rect.info[[packet.number()]]
    ## if you have more than one conditioning variable, this might be
    ## something like
    ## ri <- do.call("[", list(rect.info, as.list(which.packet())))[[1]]
    panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
               col = "grey86", border = NA)
    panel.xyplot(x, y, ...)
}


xyplot(runif(30) ~ runif(30) | gl(3, 10),
       rect.info = rectInfo,
       panel = panel.qrect)

-Deepayan

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to