[R] Error when creating layouts with partly filled pages within lattice

Hotz, T. th50 at leicester.ac.uk
Thu Jun 5 15:21:51 CEST 2003


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




More information about the R-help mailing list