Thanks! That's about 2-3x faster. I wasn't familiar with stack/unstack. Now
I have another tool.

Cheers,
e.


----

*Eric Archer, Ph.D.*

Southwest Fisheries Science Center (NMFS/NOAA)
8901 La Jolla Shores Drive
La Jolla, CA 92037 USA
858-546-7121 (work)
858-546-7003 (FAX)

Marine Mammal Genetics Group: swfsc.noaa.gov/mmtd-mmgenetics
GitHub: github/ericarcher

&

Adjunct Professor, Marine Biology
Scripps Institution of Oceanography
University of California, San Diego
http://profiles.ucsd.edu/frederick.archer


"


*The universe doesn't care what you believe. The wonderful thing about
science is that it   doesn't ask for your faith, it just asks   for your
eyes.*"  - Randall Munroe

"*Lighthouses are more helpful than churches.*"
   - Benjamin Franklin

   "*...but I'll take a GPS over either one.*"
       - John C. "Craig" George

On Wed, Nov 23, 2016 at 11:11 AM, nachti [via R] <
ml-node+s789695n472677...@n4.nabble.com> wrote:

> 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
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://r.789695.n4.nabble.com/Create-matrix-of-columns-from-grouped-rows-
> tp4726777p4726778.html
> To unsubscribe from Create matrix of columns from grouped rows, click here
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4726777&code=RXJpYy5BcmNoZXJAbm9hYS5nb3Z8NDcyNjc3N3w5MjQwOTkzNjU=>
> .
> NAML
> <http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://r.789695.n4.nabble.com/Create-matrix-of-columns-from-grouped-rows-tp4726777p4726779.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
datatable-help@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to