[R] Question: xyplot panel configurations for Trellis package

From: Zheleznyak, Anatoley <Anatoley.Zheleznyak_at_constellation.com>
Date: Fri 27 Oct 2006 - 16:04:29 GMT


Hi,
I am new to R community and I have a question on panel configurations in the Trellis package.
Particularly, I have the following code:

require(lattice)
plotTable <- NULL
Date <- seq(as.Date("2006-11-01"), as.Date("2009-12-01"), by = 1) nYear <- length(unique(format(Date,"%Y"))) plotTable$Date <- as.Date(paste(unique(format(Date, "%Y-%m")), "-01",sep = ""))
nDate <- length(plotTable$Date)
plotTable$Date <- rep(plotTable$Date, each = 10) plotTable$Date <- factor(format(plotTable$Date, "%b-%y"),  

levels=format(as.Date(unique(sort(as.character(plotTable$Date)))), "%b-%y"))
plotTable$x <- rep(seq(1,10,by = 1), nDate) plotTable$y <- rep(seq(1,10,by = 1), nDate)

xyplot(y ~ x| Date, data = plotTable,

      panel=function(x,y){ panel.xyplot(x,y, type = "l", lwd = 3) },
      layout = c(12,nYear),
      main = "Example of the panels by months")

I would be interested to configure panels by years horizontally, so 2006, 2007, 2008, and 2009 all have different rows, and the months will be structured by columns,
Thank you,



Anatoley Zheleznyak
Risk Management Group
Constellation Commodities Group
tel: 410-230-5663

>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for the addressee. If you are not the intended recipient, do not use the information in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Oct 28 02:06:43 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 27 Oct 2006 - 18:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.