Skip to content
Prev 73500 / 398498 Next

getting panel.loess to use updated version of loess.smooth

Benjamin Tyner wrote:
Can you show us what you tried? It seems as simple as defining a new 
panel function:

panel.loess2 <- function (x, y, span = 2/3, degree = 1,
                           family = c("symmetric", "gaussian"),
                           evaluation = 50, lwd = add.line$lwd,
                           lty = add.line$lty, col,
                           col.line = add.line$col, ...) {
   x <- as.numeric(x)
   y <- as.numeric(y)
   if (length(x) > 0) {
       if (!missing(col)) {
           if (missing(col.line))
               col.line <- col
       }
       add.line <- trellis.par.get("add.line")
       #smooth <- loess.smooth(x, y, span = span, family = family,
       #                       degree = degree, evaluation = evaluation)
       smooth <- simpleLoess(x, y, span = span, family = family,
                             degree = degree, evaluation = evaluation)
       grid.lines(x = smooth$x, y = smooth$y, default.units = "native",
                  gp = gpar(col = col.line, lty = lty, lwd = lwd))
   }
}


--sundar