On Fri, Mar 21, 2014 at 11:05 AM, Steve Lianoglou
<lianoglou.steve@gene.com>wrote:

> Howdy,
>
> On Fri, Mar 21, 2014 at 9:12 AM, Michael Lawrence
> <lawrence.michael@gene.com> wrote:
> > Not really sure how ddply works (the "." syntax seems a bit weird) but I
> > think you want something like:
> >
> > do.call(c, tapply(gr, list(gr$transcript_id, gr$type), function(tt) {
> > }, simplify=FALSE))
>
> Clever -- somehow I never realized we had specialized versions of more
> than just lapply, and mapply ... maybe it's because I've never been a
> fan of `tapply` (I mean, what does the `t` mean, anyway?)
>
>
I'm pretty sure it originates from its use in generating contingency
/t/ables, see example(tapply).


> Anyway, the OP's `ggply` function would be neat -- perhaps a `bioplyr`
> package could interesting/fun for somebody whose got some time for a
> little yak shaving ... ;-)
>
>

I was thinking to achieve something close to the convenience of ddply
without moving too far from the R API would be:

aggregate(~ transcript_id + type, gr, function(tt) {
})

The default aggregate() requires a formula with an LHS, but I can see no
reason why it couldn't behave like ddply in the case where the LHS is empty.


> -steve
>
> --
> Steve Lianoglou
> Computational Biologist
> Genentech
>

	[[alternative HTML version deleted]]

