[R] Scales and bwplots

James Rome jamesrome at gmail.com
Tue Apr 13 16:03:51 CEST 2010


I would like to make a series of bwplots with scales that are the same
on each plot. x is hours of the day, so I chose
        hrs = seq(0, 24, 4)
        hrlabs = c("0","4","8","12","16","20","")                   
        g = bwplot((gdf$tt)~gdf$OnHour | gdf$Runway, data=gdf,
ylab="Taxi time (min)",
            main=title, xlab="Hour of day", 
par.strip.text=list(cex=0.7), rot=90,  xlim=c(0, 24),
            scales=list(x = list(rot=90, cex=.6, at=hrs, labels=hrlabs )),
            panel = function(x, ...) {
                panel.grid(h = -1, v = -1)                           
                               
                panel.bwplot(x, ...)                                   
                                                                       
                                                                       
                   
          } )
        plot(g)

But, some OnHours of data are missing, and the above call puts the data
at points other than the correct hour. They are placed at every hour
starting at 0 instead of their correct hour. The plot is correct if I
leave out the xlim, at, and labels arguments.

Do I need to manufacture phony data at the missing hours (that do not
plot)? If so how?

Thanks,
Jim



More information about the R-help mailing list