[R] Reverse order of grouping factor in grouppedData

RMan54 RMan54 at cox.net
Thu Dec 14 01:32:38 CET 2006


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.


-- 
View this message in context: http://www.nabble.com/Reverse-order-of-grouping-factor-in-grouppedData-tf2817711.html#a7864653
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list