I have a data frame which has 4 columns.
A.        B.        C.        D
1.        2.        4.        86
1.        2.        4.        97
1.        2.        4.        49
3.        6.        9.        78
3.        6.        9.        65
3.        6.        9.        45
The rows with same values in columns A B and C should create multiple columns D (D1, D2, D3) and stack the row wise values of D in D1, D2 and D3 in same row.
I want the output like this
A.     B.     C.     D1.    D2.   D3 
1.     2.     4.     86.    97.   49
3.     6.     9.     78.    65.   45. 
 
     
    