Skip to content
Prev 292258 / 398500 Next

User defined panel functions in lattice

On Fri, Apr 20, 2012 at 8:15 PM, David Winsemius <dwinsemius at comcast.net> wrote:
If that is indeed what's happening, it will be the first time for me.
My mailer shows upper case "L" too, I assume that this is correct and
the OP's intention is exactly that - not redefine panel.locfit but
create his own (if that is good use of his/our time is another matter
altogether). Seems to me the source of this error was, as the error
message suggested, simply the "default" formals:

 panel.Locfit <-
 function(x,y, nn, h, col, col.line, lwd = lwd, lty = lty, ...){
...
}

Which is why this solved it:

  xyplot(y ~x,xx,
       groups = Farm,
       auto.key=TRUE,lwd=1:3,
       panel = panel.superpose,panel.groups=function(x,y,nn,...){
                      panel.Locfit(x,y,nn=.9,...)
                      panel.xyplot(x,y,...)
                    }
       )

With my new found understanding of the OP's real intentions, maybe a
call to trellis.par.get('superpose.line') inside panel.Locfit is the
answer?

Cheers