[R] xyplot.zoo question about strip.left and layout

Klaus Nordhausen klausch at gmx.de
Mon Jun 9 18:18:53 CEST 2008


Dear R masters,

I have large multivariate time series as zoo objects and want to plot them using lattice.

Since I have many variates in one object I would like to have the strips on the left, using strip.left = TRUE. However when I use this the variable names are converted into numbers. How can I keep there the original variable names? (compare test1 and test2 in example below)

Furthermore would I like to print one object using several pages, having only one column - I have however not always a "nice" number of panels (variables) and then often on the last page there is a huge gap between the last drawn panel and the axis label. How can that be avoided?

Short example:

library(zoo)
library(lattice)

set.seed(1)
 z <- zoo(cbind(a = 1:5, b = 11:15, c = 21:25, d = 31:35, e = 41:45) + rnorm(5))
 
test1<-xyplot(z, as.table=TRUE , strip=TRUE , strip.left=FALSE , layout=c(1,3,2))
test2<-xyplot(z, as.table=TRUE , strip=FALSE , strip.left=TRUE , layout=c(1,3,2))

trellis.device(device="pdf", color = FALSE, file="test_z.pdf",
paper="a4" ,width = 6, height =10 )
print(test2)
dev.off()

Thanks already in advance!

Klaus

PS: I use R 2.7.0 on windows XP and lattice_0.17-8 and zoo_1.5-3. 


--



More information about the R-help mailing list