Skip to content
Back to formatted view

Raw Message

Message-ID: <CAP01uRnfp29hEqK6VTijf297KXRq0zT5wXgZEdoTj5jTg8VvwA@mail.gmail.com>
Date: 2012-12-24T21:03:42Z
From: Gabor Grothendieck
Subject: parallelized version of "by" and "ave"
In-Reply-To: <CAPr7RtX2xuMyx_OmHVnySxcrE5FjiMDMDC=D=LZEgcJQzOwP0Q@mail.gmail.com>

On Mon, Dec 24, 2012 at 1:25 PM, ivo welch <ivo.welch at gmail.com> wrote:
> Dear R experts---
>
> Has anyone written parallel versions of "by" (i.e., mcby) and "ave"
> (i.e. mcave) ?  I did ask a question like this a year ago, and then
> the answer was no.
>
> for those who are googling the group for the answer to this question,
> in the meantime, the poor man's version of "by" is mclapply( split(
> ds, factor ), FUN )
>
> I don't know the poor man's version of "ave".
>

For ave, just parallelize the lapply in this (taken from the ave source):

 split(x, g) <- lapply(spllit(x, g), FUN)

--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com