I know how to convert a simple dataframe from wide to long format with one
varying factor. However, for a dataset with two factors like the following,

Subj T1_Cond1 T1_Cond2 T2_Cond1 T2_Cond2
 1   0.125869   4.108232   1.099392   5.556614
 2   1.427940   2.170026   0.120748   1.176353

How to elegantly convert to a long form as

Subj  Time Cond  Value
1         1        1       0.125869
1         1        2       4.108232
1         2        1       1.099392
...

Thanks in advance!

Gang

	[[alternative HTML version deleted]]

