<div dir="ltr">Thank you. That did it. <div>I would still like to read more. What does one call this? What are the correct buzzwords to search for. Do you know of any blog posts / articles?</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 20, 2017 at 2:28 PM Cook, Malcolm <<a href="mailto:MEC@stowers.org">MEC@stowers.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_5870976656263013549WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Result.dt<-dt[ , list(sd.dtable=dtable(.SD)), by=trichotomous.variable] # untested<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">will return a Result.dt with 2 columns: trichotomous.variable and sd.dtable<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The value of Result.dt[1,sd.dtable][[1]] will give the 1st groups dtable results<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">~<a href="mailto:malcolm_cook@stowers.org" target="_blank">malcolm_cook@stowers.org</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> <a href="mailto:datatable-help-bounces@lists.r-forge.r-project.org" target="_blank">datatable-help-bounces@lists.r-forge.r-project.org</a> [mailto:<a href="mailto:datatable-help-bounces@lists.r-forge.r-project.org" target="_blank">datatable-help-bounces@lists.r-forge.r-project.org</a>]
<b>On Behalf Of </b>Farrel Buchinsky<br>
<b>Sent:</b> Friday, October 20, 2017 1:14 PM<br>
<b>To:</b> <a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a><br>
<b>Subject:</b> [datatable-help] Generating data.tables from a j function<u></u><u></u></p>
</div>
</div></div></div></div><div lang="EN-US" link="#0563C1" vlink="#954F72"><div class="m_5870976656263013549WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I am relatively certain that data.table can handle a function in the J position that generates a data.frame or a data.table. However, how does one handle the output? Can you please point me to a url that discusses the capability?<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">For instance, I sometimes use the package dtables to generate descriptive statistics. It generates a table for <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">So one could go<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">library(dtables)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">dtable(dt)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But what if one wanted to get descriptive statistics by a trichotomous variable<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">dt[ , dtable(.SD), by=trichotomous.variable]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>I am looking for a general article or blogpost about how to handle outputs that are not single numbers or two numbers.
</b>There are functions that yield data.tables or lists or specialized objects such a models. Any suggestions?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I know one can simply print the output to the console<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">dt[ , print(dtable(.SD)_, by=trichotomous.variable] <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But that does not let me do anything intelligent afterwards. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">-- <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">Farrel Buchinsky<u></u><u></u></p>
<div>
<p class="MsoNormal"><a href="tel:(412)%20567-7870" value="+14125677870" target="_blank">(412) 567-7870</a> (gets me everywhere)<u></u><u></u></p>
</div>
</div>
</div>
</div></div></div></blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Farrel Buchinsky<div>(412) 567-7870 (gets me everywhere)</div></div></div>