Hi there, Could someone help to compare to list. I do something like: list1<-c(1,3,6,8,9) list2<-c(3,5,1,0) mathlist<-NULL for (i in list1) { for (j in list2) { if (i==j) mathlist<-c(mathlist,i) }} mathlist Is there a more elegant way to solve this question? Kind regards Miltinho BRAZIL
--------------------------------- VocĂȘ quer respostas para suas perguntas? Ou vocĂȘ sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas! [[alternative HTML version deleted]]
______________________________________________ R-help@stat.math.ethz.ch 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.