From a data frame in this structure
1 2 3
0.2393876 0.3388785 0.4217339
0.2984463 0.3948705 0.3066832
0.3042033 0.3321453 0.3636514
0.2290906 0.2796392 0.4912702
0.1971198 0.3273682 0.4755120
0.2328518 0.3991225 0.3680256
0.3031909 0.3790213 0.3177878
0.2734835 0.3233044 0.4032121
0.3190916 0.3256503 0.3552581
0.2600000 0.3281130 0.4118871
How is it possible to compare the value in the three columns, find the highest and add the name of the column in a new variable. Example output:
1 2 3 highestcolumn
0.2393876 0.3388785 0.4217339 3
0.2984463 0.3948705 0.3066832 2
0.3042033 0.3321453 0.3636514 3