[R] how to fast extract values from different list elements

Tom Short tshort.rlists at gmail.com
Thu Feb 25 14:36:10 CET 2010


On Thu, Feb 25, 2010 at 4:10 AM, Heym, Peter-Paul <pheym at ipb-halle.de> wrote:

> this works fine but it is very slow (since A and B can be very large and I
> have to repeat this about 5000 times). I would like to make this faster using
> e.g. apply or lapply but I didn't get it work using these methods. Does
> anybody know an EFFICIENT or FAST way extract the values from L using the
> values from A and B?

Instead of L[[A[i]]][B[i]], try L[A][B]

- Tom



More information about the R-help mailing list