I have a data frame which I need to transform. I need to change the rows into unique columns based on the value of a column.
ex:
The Input DataFrame
| column_1 | column_2 |
-----------------------
|   A      |     B    |
|   A      |     C    |
|   B      |     E    |
|   B      |     C    |
|   C      |     F    |
|   C      |     G    |
The Output DataFrame
| column_1 | column_2 | column_3 |
----------------------------------
|   A      |     B    |     C    |
|   B      |     E    |     C    |
|   C      |     F    |     G    |
The final DataFrame should have all the unique values in column_1 and the values from column_2 from input DataFrame will be added as new columns in new DataFrame i.e. Column_2 and Column_3.
I have tried to use reshape and melt packages in R but I am getting erroneous data frame.