[R] Displaying data in Trellis

ilai keren at math.montana.edu
Thu Apr 19 15:41:40 CEST 2012


On Thu, Apr 19, 2012 at 2:55 AM, ce41188 <stevelavrenz at hotmail.com> wrote:
> Thank you for the reply.
>
> The more I look at this, the more confused I become. I was wondering if you
> could walk me through this a little more in detail, in particular the panel
> method function of doing things. It may be obvious to many, but I haven't
> really used Trellis before, so I'm still at the bottom of the learning
> curve.

In that case I recommend getting a hold of
 @Book{,
    title = {Lattice: Multivariate Data Visualization with R},
    author = {Deepayan Sarkar},
    publisher = {Springer},
    address = {New York},
    year = {2008},
    note = {ISBN 978-0-387-75968-5},
    url = {http://lmdvr.r-forge.r-project.org},
  }

Or working through examples of help provided by Deepayan Sarkar or
Felix Andrews in the archives.

> I think what confuses me the most is the "whichpan" variable - what does the
> "1+" do?

For those not on nabble missing the context, it was something like
mycols[1+(packet.num()==4)].
packet.number()==4 is logical, i.e. returning 0/1. There is no
mycols[0]. Replace the 1 with any number to be in another place in the
mycols vector.

You got the rest, but I think you may have missed the main lesson that
often, as in this case, there is a simple (better) solution. e.g. here
there is no panel function needed to access the colors, you can get
the same effect with

xyplot(rnorm(60)~runif(60)|gl(6,10),groups=gl(6,10),col=c(1,1,1,2,1,1))

This is same as my first example in a cleaner (but less customizable) form.

Cheers


>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Displaying-data-in-Trellis-tp4567920p4570271.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list