<div>
                    Hi Thell,
                </div><div><br></div><div>It's not late :). Thanks for your reply. Yes of course we could do the way you specified. But the usage for the feature I mentioned is quite different. I was thinking of doing something even more efficient for <a href="http://stackoverflow.com/questions/17308551/do-callrbind-list-for-uneven-number-of-column">this question on SO</a>:</div>
                <div><div><br></div><div>Arun</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Thursday, September 5, 2013 at 7:41 PM, Thell Fowler wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Perhaps a 'too late' reply, but have you thought about bringing the names into the DT, using them, then dropping them?</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">For example:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">> DT[, n:=names(DT$B)]<br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><div>> DT[,list(B=list(B),Names=list(n)),by=A]</div><div>   A     B Names</div><div>1: 1 6,7,8 a,b,c</div><div>2: 2  9,10   d,e</div><div>> DT$n<-NULL</div>
<div><br></div></div></div><div><br><br><div>On Sat, Aug 24, 2013 at 2:57 AM, Arunkumar Srinivasan <span dir="ltr"><<a href="mailto:aragorn168b@gmail.com" target="_blank">aragorn168b@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
                <div>
                    Dear all,
                </div><div><br></div>
                <div><div>Suppose we've construct a data.table in this manner:</div><div><br></div><div>x <- c(1,1,1,2,2)</div><div>y <- 6:10</div><div>setattr(y, 'names', letters[1:5])</div><div>DT<- data.table(A = x, B = y)</div>
<div><br></div><div>DT$B</div><div><div> a  b  c  d  e </div><div> 6  7  8  9 10 </div></div><div><br></div><div>You see that DT maintains the name of vector B. But if we do:</div><div><br></div><div>DT[, names(B), by=A]</div>
<div><div>   A V1</div><div>1: 1  a</div><div>2: 1  b</div><div>3: 1  c</div><div>4: 2  a</div><div>5: 2  b</div><div>6: 2  c</div></div><div><br></div><div>There are two things here: First, you see that only the names of the first grouping is correct (A = 1). Second, the rest of the result has the same names, and the result is also recycled to fit the length. Instead of 5 rows, we get 6 rows.</div>
<div><br></div><div>A way to get around it would be:</div><div><br></div><div>DT[, names(DT$B)[.I], by=A]</div><div><div>   A V1</div><div>1: 1  a</div><div>2: 1  b</div><div>3: 1  c</div><div>4: 2  d</div><div>5: 2  e</div>
</div><div><br></div><div>However, if one wants to do:</div><div><br></div><div><div>DT[, list(list(B)), by=A]$V1</div><div>[[1]]</div><div>a b c </div><div>6 7 8 </div><div><br></div><div>[[2]]</div><div> a  b </div><div>
 9 10 </div></div><div><br></div><div>You see that the names are once again wrong (for A = 2). Just the first one remains right. </div><div><br></div><div>My question is, is it allowed usage of having names for column vectors? If so, then this should be a bug. If not, it'd be a great feature to have.</div>
<div><br></div><div>Arun</div><div><br></div></div>
            <br>_______________________________________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br></div></blockquote></div><br><br clear="all">
<div><br></div>-- <br>Sincerely,<br>Thell
</div>
</div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>