[R] Access to conditioning values in "xyplot"

From: Jean-Marc Ottorini <ottorini_at_mac.com>
Date: Wed 12 Jul 2006 - 19:05:20 EST


Dear all,

   I have already searched unsuccessfully a lengthy R documentation, the archives of the list, and the Internet for a solution to this problem... Could anybody, please, have a look at it?

The following lattice graphics works well:

   residus <- xyplot (n ~ cg | di, data = myData,

                     scale = list(y = "free", x = "free"),
                     groups = bloc,
                     as.table = T,
                     xlab = "Cg",
                     ylab = "N / ha",
                     panel = function(x, y, subscripts, groups) {
                       panel.grid(h = -1, v = -1, col = "grey", lwd = 1, 
lty = 1)
                       ## --
                       ## panel.curve(expr, from, to, n = 101, 
curve.type = "l", ...)
                       ## --
                       panel.superpose(x, y, pch = c(1, 2), col = 
c("red","blue"), panel.groups = "panel.xyplot", subscripts, groups)
                     },
                     key = list( space = "top", transparent = TRUE, 
columns = 2,
                       points = list( pch = c(1, 2), col = c("red", 
"blue") ),
                       text = list( c("bloc 3", "bloc 4"))),
                     )


So far, so good, nothing tricky here...

Now I would like to uncomment this code to draw the line fitted to the points in each panel using panel.curve (expr = f(x, <di>, ...), where the function f is already known (i.e. has been fitted), depends on x, as needed, * but also on the value <di> for each panel of the conditioning variable di *, which I have no idea as how to access it...

Many thanks for your time...

Jean-Marc


Jean-Marc Ottorini               LERFoB, UMR INRA-ENGREF 1092
  email  ottorini@nancy.inra.fr          INRA - Centre de Nancy
  voice  +33-0383-394046                    F54280 - Champenoux
  fax    +33-0383-394034                                 France



----
Jean-Marc Ottorini LERFoB, UMR INRA-ENGREF 1092 email ottorini@nancy.inra.fr INRA - Centre de Nancy voice +33-0383-394046 F54280 - Champenoux fax +33-0383-394034 France ______________________________________________
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 Received on Wed Jul 12 20:34:50 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 12 Jul 2006 - 22:17:50 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.