Thursday, May 2, 2013

RG#102: Double Y axis trellis plot (weather data example)


require(latticeExtra)
require (lattice)

data(SeatacWeather)
tempatures <- xyplot(min.temp + max.temp ~ day | month,
               data = SeatacWeather, type = "l", layout = c(3, 1))
rainfall <- xyplot(precip ~ day | month, data = SeatacWeather, type = "h", lwd = 4)

doubleYScale(tempatures, rainfall, style1 = 0, style2 = 3, add.ylab2 = TRUE,
   text = c("min. T", "max. T", "rain"), columns = 3)


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.