Melting: The basics
Melting is used to transform data from wide to long format.
Starting with a wide data set:
DT = data.table(ID = letters[1:3], Age = 20:22, OB_A = 1:3, OB_B = 4:6, OB_C = 7:9)
We can melt our data using the melt function in data.table. This returns another data.table in long...