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. _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
