Hi,

I am working on some longitudinal data in wide format and I am having a problem ordering the data columns.  To expand, a subset of what I am working on is as follows;

>s
   L.qol.0 L.qol.0.08 L.qol.0.17 L.qol.0.25 L.qol.0.5 L.qol.0.42 L.qol.0.34
1      83         86         89         92        91         87         90

>names(s)
[1] "L.qol.0"    "L.qol.0.08" "L.qol.0.17" "L.qol.0.25" "L.qol.0.5" 
[6] "L.qol.0.42" "L.qol.0.34"

# in this object s (not a vector), 'L.qol' is measured at time points 0, 0.08, 0.17, 0.25, 0.34, 0.42 and 0.5.  As you can see, however, the time points are not in the correct order in object s.  Does anyone know how to order these column names along with their corresponding measurements?  Clearly s[order(s)] does not work since this just orders the corresponding measurements.

I would be extremely grateful for any help on this matter, it may be really simple, but I have tried for ages.

Thank you,

Zoe

