From deepayan at stat.wisc.edu  Mon Dec 22 18:22:25 2003
From: deepayan at stat.wisc.edu (deepayan@stat.wisc.edu)
Date: Mon Dec 22 18:20:54 2003
Subject: (PR#6005) Re: [Rd] [R] lattice: levelplot: error: min not
	meaningful
Message-ID: <20031222172225.190A610456@slim.kubism.ku.dk>



Actually, this is supposed to work (and is given as an example in my DSC-2003 
paper), and at some point, did. It seems this was broken as a consequence of 
a careless change in panel.levelplot. The first 5 lines should have been

    label.style <- match.arg(label.style)
    x <- as.numeric(x[subscripts])
    y <- as.numeric(y[subscripts])
    minXwid <- min(diff(sort(unique(x))))
    minYwid <- min(diff(sort(unique(y))))

instead of

    label.style <- match.arg(label.style)
    minXwid <- min(diff(sort(unique(x))))
    minYwid <- min(diff(sort(unique(y))))
    x <- as.numeric(x[subscripts])
    y <- as.numeric(y[subscripts])

I'll fix it eventually, for now a workaround is to have

levelplot( yield ~ year * variety | site, barley, 
          panel = function(x, y, ...) {
              x <- as.numeric(x) 
              y <- as.numeric(y) 
              panel.levelplot(x, y, ...)
           })


Deepayan


On Monday 22 December 2003 10:52, Prof Brian Ripley wrote:
> From the help page:
>
> formula: a formula of the form 'z ~ x * y | g1 * g2 * ...', where 'z'
>           is a numeric response, and 'x, y' are numeric values
>           evaluated on a rectangular grid.
>
> Please explain why you think that acting as documented necessitates a bug
> report?
>
> On Mon, 22 Dec 2003 wolfram@fischer-zim.ch wrote:
> > R 1.8.1:
> >
> > ___COMMAND____________________________________________
> >
> > levelplot( yield ~ year * variety | site, barley )
> >
> >
> > ___ERROR_MESSAGE______________________________________
> >
> > Error in Summary.factor(..., na.rm = na.rm) :
> >         "min" not meaningful for factors
> >
> > ___COMMENT____________________________________________
> >
> > levelplot( yield ~ as.numeric(year) * as.numeric(variety) | site, barley
> > ) is working but the labels are nasty.
> >
> > Best regards
> > Wolfram
> >
> > ______________________________________________
> > R-devel@stat.math.ethz.ch mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel


(PR#6005) Re: [Rd] [R] lattice: levelplot: error: min not meaningful
deepayan@stat.wisc.edu