I hope there is a simple answer here, but I canβt find it anywhere.
I have a number matrix with labeled rows and columns:
1 2 3 4 a 6 7 8 9 b 8 7 5 7 c 8 5 4 1 d 1 6 3 2
I would like for data.table (or data.frame, which I can convert) of the form:
col row value 1 a 6 1 b 8 1 c 8 1 d 1 2 a 7 2 b 7 2 c 5 2 d 6 ...
Any advice appreciated.
r dataframe data.table reshape transformation
Ina
source share