[R] Searching and deleting elements of list

jastar mswierniak at o2.pl
Thu Mar 8 12:31:17 CET 2007


Hi,
I have a problem. Please, look at example and try to help me!!

> A<-c("aaa","bbb","ccc","ddd","eee")
> B<-c("vvv","ooo","aaa","eee","zzz","bbb")
> C<-c("sss","jjj","ppp","ddd")
> D<-c("bbb","ccc")
>mydata=list(A,B,C,D)

I want to find and delete from 'mydata' all elements which occur in A
(except A). 
I mean after "operation":
> mydata[[1]]
[1] "aaa" "bbb" "ccc" "ddd" "eee"
> mydata[[2]]
[1] "vvv" "ooo" "zzz"
> mydata[[3]]
[1] "sss","jjj","ppp"
> mydata[[4]]
NULL

My list have about 10000 subelements (each contains several strings) so
using loops is senseless.

Thank's for all replies and sorry for my English (I hope you understand what
I'm talking about) :-)
 
-- 
View this message in context: http://www.nabble.com/Searching-and-deleting-elements-of-list-tf3368489.html#a9372270
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list