You could use: mapply(`==`, sapply(foo,`[`,1),1) # A B C # TRUE TRUE FALSE A.K.
On Thursday, June 26, 2014 10:50 PM, ce <zadi...@excite.com> wrote: Dear all, I have a list of arrays : foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1)) > foo $A [1] 1 3 $B [1] 1 2 $C [1] 3 1 I want to use all foo$A , foo$B and foo$C in a test : > foo$A[1] == 1 [1] TRUE > foo[[1]][1] == 1 [1] TRUE > foo[[1:3]][1] == 1 Error in foo[[1:3]] : recursive indexing failed at level 2 Is there a regular expression I can use ? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.