hi,

I have a list L having more than 14000 Elements, each of these contains an
array of about length 1200.

> L[[1]][26:30] # e.g. print 5 entries of first element of L
[1]   0.0000000   6.7982652 114.4737184  89.7328239   3.2001664

Furthermore I get two arrays A and B of same length as input.

A<-c(4,7,9,34,463,788)
B<-c(50,67,87,361,45,89)

I would like to extract (or print or save) certain values of L which I do in
the following (inefficient) way at the moment:

for (i in 1:length(A) {
	print( L[[A[i]]][B[i]] ) }

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?

thanks for your answers.
Peter

	[[alternative HTML version deleted]]

