best way to transpose data.table

后端 未结 6 1920
渐次进展
渐次进展 2020-11-30 22:18

[UPDATE: there is now a native transpose() function in data.table package]

I often need to transpose a data.table, every time

6条回答
  •  孤城傲影
    2020-11-30 22:28

    df <- as.data.frame(t(mydata))
    

    is what I tried and df is a data.frame and the column names on mydata are now row names on df

提交回复
热议问题