I have a data frame which looks like this
beta1 beta2 beta3
4 67 89
33 7 78
6 99 33
etc
Now I want to transform this data frame to a different dataframe which looks like
col1 col2
4 beta1
33 beta1
6 beta1
67 beta2
etc
So, the columns have to be pasted below eachother and the second column should consist of the colnames of the first data frame. Does anyone know how to do this without loop?