[datatable-help] Idea/feature request

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Mar 2 22:19:17 CET 2011


Hi,

On Wed, Mar 2, 2011 at 4:22 AM, Matthew Dowle <mdowle at mdowle.plus.com> wrote:
> Yes, good idea. I thought the grouping columns would already be in scope
> actually, that was an oversight. Intention was just to change .SD. The
> first item of each group needs to be installed in scope then. If you
> feel like looking: internally .SD points to itself so you can use
> variables alongside .SD. It's the upper level that needs a small loop to
> set them. I didn't like the .BY on first glance, but thinking about it
> maybe that could be useful too in cases when you write generic code that
> works when the by column names vary. You could have .BY pointing to
> itself, too. .BY would contain a set of 1-length vectors.  There's a FAQ
> that answers why j needs grp[1] rather than grp, so that would be better
> and no longer needed as grp would be length 1 anyway. Sorry I realise
> that's all English and no R examples, will add later if needed.

I actually got the gist of it.

I agree that .BY is a bit ugly, but I was also thinking of the
"generic code" scenario you mentioned.

I didn't think of just installing the by variables in scope as well so
we can reference them like we do the column names of the current .SD
(ie. no qualifiers/whatever needed), but that'd be quite nice, too.

I'll take some time to look at the implementation details later,
though I reckon I'll be chasing my tail for a while there.

Thanks,
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact


More information about the datatable-help mailing list