 I should amend this: it would be a method for the List class. Many of the
Vector classes are "atomic" and coercing them to a list is either not
supported or may yield an undesired result. For example, coercing an
IRanges to a list yields a list of integer vectors with the sequence from
start to end. We don't have an lapply,Vector for this reason.

I actually already made a commented-out mcseqapply. I think I aborted the
mc* stuff back before the parallel package existed, just to avoid adding a
dependency on multicore. With parallel in base R, it's reasonable to add
these methods. If no one else complains, I'll move ahead.

Michael

On Mon, Sep 24, 2012 at 6:23 AM, Michael Lawrence <michafla@gene.com> wrote:

> It definitely makes sense to have a generic for mclapply that dispatches
> on Vector. Perhaps also for some of the other apply functions in the
> parallel package.
>
> Michael
>
>
> On Mon, Sep 24, 2012 at 3:58 AM, Hahne, Florian <
> florian.hahne@novartis.com> wrote:
>
>> Would it be possible to make mclapply aware of the Vector class?
>> Currently, the following line causes them to be coerced into a regular
>> list which could be rather expensive for instance in the case of
>> GrangesLists:
>> if (!is.vector(X) || is.object(X))
>>         X <- as.list(X)
>>
>>
>> I guess something like
>> if ((!is.vector(X) && !is(X, "Vector")) || is.object(X))
>>         X <- as.list(X)
>> would do the trick.
>>
>> Or am I missing something obvious here?
>> Cheers,
>> Florian
>>
>> _______________________________________________
>> Bioc-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
>

	[[alternative HTML version deleted]]

