Let's say I have a dataframe with columns a,b,c,d,e,f,g,h.
I want to add up the values of column d and e and create a column containing the results right after d and e such that it becomes:
a,b,c,d,e,newcolumn,f,g,h
Is there any way to do this? As I have found it very frustrating to reorder columns in R, especially when you have a huge dataframe with many columns.
Any help is appreciated!