[R] Finding matches in 2 files

jim holtman jholtman at gmail.com
Thu Jul 26 14:20:15 CEST 2007


Is this what you want?

> g1<-c("gene1", "gene2", "gene3", "gene4", "gene5", "gene9", "gene10",
+ "geneA")
> g2<-c("gene6", "gene9", "gene1", "gene2", "gene7", "gene8", "gene9",
+ "gene1", "gene10")
> intersect(g1,g2)
[1] "gene1"  "gene2"  "gene9"  "gene10"


On 7/25/07, jenny tan <timpanisterwombat at hotmail.com> wrote:
>
>
> I have 2 files containing data analysed by 2 different methods. I would like to find out which genes appear in both analyses. Can someone show me how to do this?
> _________________________________________________________________
> [[trailing spam removed]]
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list