[UPDATE: there is now a native transpose() function in data.table package]
transpose()
data.table
I often need to transpose a data.table, every time
The current docs show a builtin transpose method.
transpose
Specifically, you can do:
transpose(mydata, keep.names = "col", make.names = "col0") ## col row1 row2 row3 ## 1: col1 11 21 31 ## 2: col2 12 22 32 ## 3: col3 13 23 33