paste, by and data.table in r

后端 未结 2 1923
既然无缘
既然无缘 2021-01-05 07:07

I\'m trying to paste strings from a reshaped dataset. I\'m using the data.table package as follows:

m<-data.frame(x=rep(c(\"a\",\"b\"),20),y=factor(sample         


        
2条回答
  •  难免孤独
    2021-01-05 07:43

    For completeness' sake, an official answer:

    If you use paste(y,collapse=",") instead, it should work.

提交回复
热议问题