Hotz, T.
2003-Jun-05 13:21 UTC
[R] Error when creating layouts with partly filled pages within lattice
Dear all, Please take my apologies if that has already been asked - at least I couldn't find it in the archives. When trying to specify a layout within library lattice, i.e. using xyplot, I get an error when the prepanel function tries to subscript the automatically generated x.limits. This seems to appear if the last page wouldn't be filled completely, i.e. there would be space left for more panels. Please see session snippet for a simple example. Am I missing something? Any hints highly appreciated. Cheers Thomas ---> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 7.0 year 2003 month 04 day 16 language R> n<-900 > my.data<-data.frame(x=1:n,y=rnorm(n)) > my.shingle<-shingle(my.data$x,cbind(0:8*100,1:9*100)) > xyplot(y~x|my.shingle,data=my.data,as.table=T,scales=list(x=list(relation="sliced")),layout=c(1,2)) > xyplot(y~x|my.shingle,data=my.data,as.table=T,scales=list(x=list(relation="sliced")),layout=c(1,3)) > xyplot(y~x|my.shingle,data=my.data,as.table=T,scales=list(x=list(relation="sliced")),layout=c(1,4))Error in x.limits[[i]] : subscript out of bounds> traceback()2: limits.and.aspect(prepanel.default.xyplot, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, nplots = nplots) 1: xyplot(y ~ x | my.shingle, data = my.data, as.table = T, scales = list(x = list(relation = "sliced")), layout = c(1, 4)) --- P.S. Allow me to take the opportunity to give big thanks to Deepayan Sarkar for writing and maintaining this brilliant package! --- Thomas Hotz Research Associate in Medical Statistics University of Leicester United Kingdom Department of Epidemiology and Public Health 22-28 Princess Road West Leicester LE1 6TP Tel +44 116 252-5410 Fax +44 116 252-5423 Division of Medicine for the Elderly Department of Medicine The Glenfield Hospital Leicester LE3 9QP Tel +44 116 256-3643 Fax +44 116 232-2976
Deepayan Sarkar
2003-Jun-05 17:32 UTC
[R] Error when creating layouts with partly filled pages within lattice
Could you try with the latest lattice (0.7-13) ? I don't see an error with it. It's not immediately obvious to me where the problem could have come from, but there were a bunch of similar problems fixed recently. On Thursday 05 June 2003 08:21, Hotz, T. wrote:> Dear all, > > Please take my apologies if that has already been asked > - at least I couldn't find it in the archives. > > When trying to specify a layout within library lattice, > i.e. using xyplot, I get an error when the prepanel > function tries to subscript the automatically generated > x.limits. This seems to appear if the last page wouldn't > be filled completely, i.e. there would be space left > for more panels. Please see session snippet for a simple > example. > > Am I missing something? Any hints highly appreciated. > > Cheers > > Thomas