[R] two questions re: the use of lattice (Q1 SOLVED, not Q2)
maitra.mbox.ignored at inbox.com
Mon Jul 23 07:34:07 CEST 2012
On Sun, 22 Jul 2012 22:05:14 -0700 Bert Gunter <gunter.berton at gene.com>
> > On Sun, Jul 22, 2012 at 8:26 PM, Ranjan Maitra
> > <maitra.mbox.ignored at inbox.com> wrote:
> >>> Just reset the levels of z$sigma (and also redefine sigmaExpr):
> >>> z$sigma <- factor(z$sigma,
> >>> levels = c(5,10,20,30,50)) # new levels order
> >>> sigmaExprList <- lapply(as.numeric(levels(z$sigma)),
> >>> function(s) bquote(sigma == .(s)))
> >>> sigmaExpr <- as.expression(sigmaExprList)
> >>> INUExpr <- paste0("INU = ", c(0,20,40), "%")
> >>> p <- bwplot(Error ~ Method | sigma + INU, data = z,
> >>> scales = list(rot=90), horiz = FALSE,
> >>> layout = c(5,3), col = "red")
> >>> useOuterStrips(p,
> >>> strip = strip.custom(
> >>> factor.levels = sigmaExpr),
> >>> strip.left = strip.custom(
> >>> factor.levels = INUExpr)
> >>> )
> >> One last question: how do I draw a line h = 0, lty =2 through each plot?
> > ?panel.abline
> > If you don't know how to use this in a panel function, time to start
> > doing your own "homework." Panel functions are central to the trellis
> > paradigm, so an honest effort to learn these details will be worth the
> > effort. A good place to start is the examples in the above help file.
> > There are also numerous online tutorials and websites. Google. Also
> > check Deepyan Sarkar's (lattice's author) web page.
Thanks a lot for your tip! I have always wondered where to get more
help on figuring out about these things so it will be very useful for
me: definitely, it will be helpful for me to figure out how to do what
you suggest in a panel function.
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!
More information about the R-help