i am trying to do this in R. it is equivalent to the stata command
suppose i have four columns as shown below (T1, T2, T3, T4). I want to create a new column (TX) which contains for each row the first element in columns T1:T4.
thank you everyone!!
Code:
rowfirst
Code:
ID T1 T2 T3 T4
A 0 2 4 5
B . . 6 5
C . 8 6 1
D . . . 9
ID TX
A 0
B 6
C 8
D 9