[R] reshape

Ngayee J Law Ngayee.Law at celeradiagnostics.com
Mon Sep 9 19:59:13 CEST 2002


Hi,

I have a problem using the function 'reshape' for the following dataset:

input:
X    Y    Z    T.U.1     T.U.2     T.V.1      T.V.2
1.00 1.00 A    24.94     24.74     34.65      35.33
1.00 3.00 A    26.03     25.87     25.76      26.12
1.00 1.00 B    24.76     24.63     34.34      34.48
1.00 3.00 B    26.15     25.98     25.96      25.66
2.00 1.00 A    24.40     24.26     34.55      36.53
2.00 4.00 A    24.55     24.40     35.52      39.61
2.00 1.00 B    25.00     24.76     35.32      36.67
2.00 4.00 B    25.96     25.70     26.00      25.62

target output:
X    Y    Z    T    Time W
1.00 1.00 A    U    1    24.94
1.00 1.00 A    U    2    24.74
1.00 1.00 A    V    1    34.65
1.00 1.00 A    V    2    35.33
1.00 3.00 A    U    1    26.03
1.00 3.00 A    U    2    25.87
1.00 3.00 A    V    1    25.76
1.00 3.00 A    V    2    26.12
1.00 1.00 B    U    1    24.76
1.00 1.00 B    U    2    24.63
1.00 1.00 B    V    1    34.34
1.00 1.00 B    V    2    34.48
1.00 3.00 B    U    1    26.15
1.00 3.00 B    U    2    25.98
1.00 3.00 B    V    1    25.96
1.00 3.00 B    V    2    25.66
2.00 1.00 A    U    1    24.40
2.00 1.00 A    U    2    24.26
2.00 1.00 A    V    1    34.55
2.00 1.00 A    V    2    36.53
2.00 4.00 A    U    1    24.55
2.00 4.00 A    U    2    24.40
2.00 4.00 A    V    1    35.52
2.00 4.00 A    V    2    39.61
2.00 1.00 B    U    1    25.00
2.00 1.00 B    U    2    24.76
2.00 1.00 B    V    1    35.32
2.00 1.00 B    V    2    36.67
2.00 4.00 B    U    1    25.96
2.00 4.00 B    U    2    25.70
2.00 4.00 B    V    1    26.00
2.00 4.00 B    V    2    25.62


There are more than 1 varying for the idvar (X, Y, Z) and there are two
variables
for the varying option (U, V). Any ideas how to use reshape for this
problem?
Thanks!

Jackie







-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list