I have a dataframe:
ID value1 value2
1 f a
2 k p
3 c j
I want to replace values in column value1 with values from value2 and remove column value2. So desired result is:
ID value1
1 a
2 p
3 j
I need to do it with data.table. And i need to do it with function, not recreating dataframe from scratch.