<div>
                    <div>you can just do:</div><div><br></div><div><font face="Courier New">> DT[J(letters[4:6]), list(v1=v1, 1),by=v3]</font></div><div><br></div><div>If you use `by` only the columns in it will be included in the output. But it seems like what you request is a nicer feature and I am for it. Because, when you just do, <font face="Courier New">DT[J(letters[4:6]), sum(v1)] </font>it gives you "v1". But when using `by`, it disappears. I find with your suggestion this would be more consistent.</div><div><br></div>
                </div>
                <div><div><br></div><div>Arun</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Friday, June 21, 2013 at 10:26 PM, Frank Erickson 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">Hi,<div><br></div><div style="">I thought that when joining with J(x) and doing by=y, all the columns involved were put into .BY. However, I see that they are not:</div><div style=""><br></div><div style=""><div><font face="courier new, monospace">DT <- data.table(v1=letters[1:10],v2=1:10,v3=c(TRUE,FALSE),key="v1")</font></div>

<div><font face="courier new, monospace">DT[J(letters[4:6]),1,by=v3]</font></div><div><br></div><div style="">I think I've just forgotten how to do this correctly (so that both v1 and v3 show up in the output). Any help would be appreciated.</div>

<div style=""><br></div><div style="">Thanks,</div><div style=""><br></div><div style="">Frank</div></div></div>
</div><div><div>_______________________________________________</div><div>datatable-help mailing list</div><div><a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a></div><div><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>