[R] simple reshape
Troels Ring
tring at gvdnet.dk
Tue Jan 22 09:19:17 CET 2013
Dear friends - this is a very simple question - I have a data frame
'data.frame': 87 obs. of 3 variables:
$ ID : int 1 1 1 2 2 2 3 3 3 4 ...
$ prep : num 1.18 1.38 1.34 1.93 2.38 2.24 1.17 1.13 1.21 1.89 ...
$ postp: num 0.63 0.71 0.75 1.01 1.12 1.07 0.87 0.64 0.7 0.8 ...
- 29 persons (ID) each measured three times before and after an
intervention: prep and postp -
I need data rearranged like
ID time val
1 1 prep
1 2 postp
1 1
1 2
1 1
1 2
I cannot make reshape or stack do the trick.
I'm on windows 7
R version 2.15.2 (2012-10-26)
Best wishes
Troels Ring, Nephrology
Aalborg, Denmark
More information about the R-help
mailing list