From a dataframe like this:
dframe = data.frame(data = c(1), error = c(3))
How can we melt the data aiming to have the col names as values.
Here an example of expected output
dframe_ex = data.frame(id=c("data","error"), num=c(1,3))
dframe_ex
id num
1 data 1
2 error 3