On 12/13/06, RMan54 <[EMAIL PROTECTED]> wrote:
>
> I created the following groupedData object (nlme library):
>
> gd <- groupedData(Conc ~ Time | Subj,
>     order.groups=T,
>     FUN = myf,
>     data=mydata)
>
> The idea of the myf function is to reverse the order of the grouping factor
> Subj (or better, reorder from largest to smallest). In the mydata data set,
> Subj is an integer that gets converted into a factor in the groupedData
> object.
> Does anyone knows how to write this function myf?
>
> It may be even impossible to do it this way because the function is applied
> on the dependent variable Conc (default in the package is mean), while I
> need to apply my stuff on the factor Subj.
>
> The lattice plot routines underneath the nlme library (like xyplot)
> unfortunately start plotting the panels on the bottom of the page and up. In
> order to have the order in a logical fashion (smallest to highest subj
> number starting on top of the page and down), I need to reorder in the
> groupedData object.

Why? Why not consider the more natural solution of reordering while
plotting? The 'as.table' argument of xyplot allows you to order panels
from top to bottom, and arguments to xyplot etc can be passed to
plot(groupedData.obj...) calls directly. If you feel that the default
is "unfortunate", you can even change it globally using

lattice.options(default.args = list(as.table = TRUE))

-Deepayan

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to