[R] Lattice key seems to ignore the key list

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Wed Sep 7 15:09:39 CEST 2005



Patrick Connolly wrote:
> I've never had this problem before and can't see what could be
> different from other times I've used keys with lattice.
> 
> 
> 
> It appears that auto.key is being taken as TRUE when I specify a key
> list.  The list I specify seems to be ignored.
> 
> Where can I place a browser to figure out what is going on?
> 
> Having made a list key.symbol from trellis.par.get, and specified a
> scales list and a between list, and a formula object (form), I use
> xyplot like this:
> 
> xyplot(form, data = xx, groups = Entry, layout = c(8,8, 1), 
>                 par.strip.text = list(cex = .65), between = between,
>                 scales = scales,
>                 panel = function(x, y, ...)
>                   panel.superpose(x, y, ...),
>                 key = list(points = Rows(key.symbol, 1:4),
>                   text = list(levels(xx$Entry),
>                     space = "right", columns = 1))
>                 )
> 
> What is implied in there that would set auto.key to TRUE?  The space
> and columns part of the list seems to be ignored and the autokey
> values substituted.  
> 
> Ideas, please.
> 
> Thanks.
> 

Hi, Patrick,

You have "space" and "column" in your "text" list. I.e.

text = list(levels(xx$Entry), space = "right", columns = 1))

This should be

text = list(levels(xx$Entry)), space = "right", columns = 1)

Note the placement of the parantheses.

--sundar




More information about the R-help mailing list