s-news
[Top] [All Lists]

Data subsetting in panel functions

To: "Splus Posting" <s-news@lists.biostat.wustl.edu>
Subject: Data subsetting in panel functions
From: "Jonathan Dakin" <jd@johndakin.demon.co.uk>
Date: Thu, 10 Jun 2004 11:41:51 +0100
Importance: Normal

I'm having trouble with data subsetting in panel functions, which are new to me, and would be grateful for any wisdom.

I have a set of coordinate data (x,y), which I'm examining by a conditioning variable (var).

I would like to add a geographical bounding line to each panel in the trellis, which corresponds to the whole dataset.  Therefore I write a few lines to define the x and y bounding coordinates by two vectors:  x.out <- ###,  y.out <- ###

I write a panel function to perform the plot:

xyplot(y ~ x | var, data="">
        panel=function(x,y) {
               
                x.out <- ###; y.out <- ###
               
                panel.xyplot(x, y)
                points(out.x, out.y, type="l")
                }
        )

The problem is that the outline coordinates also get conditioned on var, so that I just have a portion of the outline in each.

I think the answer lies with the subscripts argument, but I can't work out how.
Many thanks.  Putting the code which defines the dataset outside the panel function does not help.

Many thanks.
Jonathan Dakin

<Prev in Thread] Current Thread [Next in Thread>
  • Data subsetting in panel functions, Jonathan Dakin <=