[datatable-help] Create matrix of columns from grouped rows
nachti
kpm.nachtmann at gmail.com
Wed Nov 23 20:11:30 CET 2016
Try this:
t1 <- dt[, unlist(.SD), by = id]
t(unstack(t1, form = V1 ~ id))
(I think you get done with the colnames yourself ...)
Cheers,
~g
--
View this message in context: http://r.789695.n4.nabble.com/Create-matrix-of-columns-from-grouped-rows-tp4726777p4726778.html
Sent from the datatable-help mailing list archive at Nabble.com.
More information about the datatable-help
mailing list