[R] lattice problem in R-1.9.0

Sundar Dorai-Raj sundar.dorai-raj at PDF.COM
Wed Apr 14 00:53:15 CEST 2004



Deepayan Sarkar wrote:

> On Tuesday 13 April 2004 12:51, Sundar Dorai-Raj wrote:
> 
>>Hi all,
>>   I just installed R-1.9.0 on Windows 2000 from binaries. Yesterday,
>>on R-1.8.1 I ran a script that looked like:
>>
>>library(lattice)
>>tmp <- expand.grid(A = 1:3, B = letters[1:2])
>>tmp$z <- runif(NROW(tmp))
>>trellis.device(png, file = "x1081.png", theme = col.whitebg)
>>xyplot(z ~ A | B, data = tmp,
>>        panel = function(x, y, i) {
>>          panel.xyplot(x, y)
>>          ltext(1, 0.95, paste("i =", i), adj = 0)
>>        },
>>        ylim = c(0, 1),
>>        i = 10)
>>dev.off()
>>
>>In R-1.9.0, the same script gives the following error message:
>>
>>Error in trellis.skeleton(cond = structure(list(B =
>>structure(as.integer(c(1,  :
>>	Invalid value of index.cond
> 
>                          ^^^^^^^^^^
> 
> 
> 
>>I've tracked it down to including the argument "i" to the panel
>>function. If I change the argument to
>>
>>xyplot(z ~ A | B, data = tmp,
>>        panel = function(x, y, I) {
>>          panel.xyplot(x, y)
>>          ltext(1, 0.95, paste("i =", I), adj = 0)
>>        },
>>        ylim = c(0, 1),
>>        I = 10)
>>
>>all is copacetic. There is no argument in xyplot that starts with "i"
>>so I don't know where the partial matching is occurring.
> 
> 
> Actually, in R 1.9.0, xyplot() does have a new argument that starts with 
> i, namely 'index.cond' (as indicated by the error message above). This 
> (along with many other arguments) doesn't show up in args(xyplot) 
> because of the way arguments common to high-level lattice functions are 
> handled by common code (they are formally part of ...); but it is 
> documented in ?xyplot.
> 
> Deepayan
> 

Sorry, should have caught that. As you suspected all I did was 
args(xyplot). I wasn't expecting a new argument.

Thanks for the quick reply.

--sundar




More information about the R-help mailing list