s-news
[Top] [All Lists]

Re: Help request for trellis panel function

To: David Parkhurst <parkhurs@imap.iu.edu>
Subject: Re: Help request for trellis panel function
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Wed, 19 Jul 2006 13:05:14 -0500
Cc: s-news@wubios.wustl.edu
In-reply-to: <44BE731E.90809@imap.iu.edu>
Organization: PDF Solutions, Inc.
References: <44BE731E.90809@imap.iu.edu>
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)


David Parkhurst wrote:
I have a data frame with five columns, x, y, A, B, and C. x and y are continuous numeric variables, and the others are factors.

A has 5 levels, B has 2, and C has 6. I'd like to produce a 5X2 trellis of xyplots, using different symbols for the different values of factor C. In addition, I'd like each of the ten panels to include a 1:1 line.

I know this would require a special panel function, but I don't know what it should look like. I would much appreciate help in creating it.

Thank you.

David Parkhurst


How about this (untested) code:

xyplot(y ~ x | A * B, data = mydata, groups = C,
       panel = function(x, y, subscripts, groups, ...) {
         panel.superpose(x, y, subscripts, groups, ...)
         panel.abline(0, 1)
       }, layout = c(2, 5))

Here "mydata" is a data.frame with columns "x", "y", "A", "B", and "C".

--sundar

<Prev in Thread] Current Thread [Next in Thread>