[R] Problem with data frame when using xYplot?

Deepayan Sarkar deepayan at stat.wisc.edu
Fri May 13 17:51:57 CEST 2005


On Friday 13 May 2005 10:36 am, Sander Oom wrote:
> Hi Deepayan!
>
> Deepayan Sarkar wrote:
> > On Friday 13 May 2005 08:07 am, Sander Oom wrote:
> >>An off list response from Mat Soukop (thanks Mat!!) provides an even
> >>more elegant solution (see code below)! I have included the original
> >>code, so people can decide whether to plot in a single panel or in
> >>multiple panels. Now we have a fully functional workaround to get
> >>plotmeans{gplots} for multiple factors using lattice! Great!
> >
> > Just out of curiousity, does replacing the 'xlim' and 'scales' arguments
> > above by
> >
> > xlim = levels(tmp$Position)
> >
> > do the same thing? It should with xyplot (which also allows the x
> > variable to be a factor), but xYplot may be bypassing that.
>
> You mean: xlim = levels(tmp$AltGeo)....yes it does!? 

No, I meant exactly what I wrote, and my comment followed this piece of code 
(which you have deleted from your reply):

---------
tmp$PosNum <- unclass(tmp$Position)
tmp
(labs <- unique(tmp$Position))
# plot factor levels in seperate panels
xYplot(Cbind(Sodium,Lower,Upper) ~ PosNum|AltGeo, data=tmp, nx=FALSE,
   xlim=c(0.5,2.5),
   ylim=c(min(tmp$Lower)-1,max(tmp$Upper)+1),
   scales = list(x = list(at=seq(1, 2, by=1), labels = labs)),
   xlab="Position", ylab="Sodium"
   )
----------

> No clue how one would ever get comfortable with all these options!

By reading the manual, of course :-)

Deepayan




More information about the R-help mailing list