Skip to content

reordering a data.frame

1 message · Liaw, Andy

#
Use reshape(), as:
id est0 est1 est2 est3 est4 est5 est6 est7
1  1    1    2    3    1    7    9    3    4
2  2    4    1    1    7    6    5    1    2
direction="long")
id time est0
1.0  1    0    1
2.0  2    0    4
1.1  1    1    2
2.1  2    1    1
1.2  1    2    3
2.2  2    2    1
1.3  1    3    1
2.3  2    3    7
1.4  1    4    7
2.4  2    4    6
1.5  1    5    9
2.5  2    5    5
1.6  1    6    3
2.6  2    6    1
1.7  1    7    4
2.7  2    7    2

Andy