<div dir="ltr">Thanks! That's about 2-3x faster. I wasn't familiar with stack/unstack. Now I have another tool.<div><br></div><div>Cheers,</div><div>e.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div>----<div><br><b>Eric Archer, Ph.D.</b></div><div><b><br></b>Southwest Fisheries Science Center (NMFS/NOAA)<br>8901 La Jolla Shores Drive<br>La Jolla, CA 92037 USA<br>858-546-7121 (work)<br>858-546-7003 (FAX)<br><br><span style="font-size:12.8px">Marine Mammal Genetics Group: </span><a href="http://swfsc.noaa.gov/mmtd-mmgenetics" style="font-size:12.8px" target="_blank" rel="nofollow" link="external">swfsc.noaa.gov/mmtd-mmgenetics</a><br style="font-size:12.8px"><span style="font-size:12.8px">GitHub: </span><a href="https://github/ericarcher" style="font-size:12.8px" target="_blank" rel="nofollow" link="external">github/ericarcher</a><br><br>&</div><div><br><div>Adjunct Professor, Marine Biology</div><div>Scripps Institution of Oceanography</div><div>University of California, San Diego</div><div><a href="http://profiles.ucsd.edu/frederick.archer" target="_blank" rel="nofollow" link="external">http://profiles.ucsd.edu/frederick.archer</a><br></div><div><br></div><br>"<i>The universe doesn't care what you believe.<br> The wonderful thing about science is that it<br>   doesn't ask for your faith, it just asks<br>   for your eyes.</i>"  - Randall Munroe<br><br>"<i>Lighthouses are more helpful than churches.</i>"<br>   - Benjamin Franklin<br><br>   "<i>...but I'll take a GPS over either one.</i>"<br>       - John C. "Craig" George </div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Nov 23, 2016 at 11:11 AM, nachti [via R] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=4726779&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        Try this:
<br><br>t1 <- dt[, unlist(.SD), by = id]
<br>t(unstack(t1, form = V1 ~ id))
<br><br>(I think you get done with the colnames yourself ...)
<br><br>Cheers,
<br>~g

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://r.789695.n4.nabble.com/Create-matrix-of-columns-from-grouped-rows-tp4726777p4726778.html" target="_blank" rel="nofollow" link="external">http://r.789695.n4.nabble.com/<wbr>Create-matrix-of-columns-from-<wbr>grouped-rows-<wbr>tp4726777p4726778.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Create matrix of columns from grouped rows, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="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" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://r.789695.n4.nabble.com/Create-matrix-of-columns-from-grouped-rows-tp4726777p4726779.html">Re: Create matrix of columns from grouped rows</a><br/>
Sent from the <a href="http://r.789695.n4.nabble.com/datatable-help-f2315188.html">datatable-help mailing list archive</a> at Nabble.com.<br/>