[R] Access to conditioning values in "xyplot"

Jean-Marc Ottorini ottorini at mac.com
Wed Jul 12 11:05:20 CEST 2006


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 at 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 at nancy.inra.fr          INRA - Centre de Nancy
  voice  +33-0383-394046                    F54280 - Champenoux
  fax    +33-0383-394034                                 France



More information about the R-help mailing list