[R] determining the difference between 2 character strings

Philip Robinson philip.c.robinson at gmail.com
Sun Jan 15 09:28:48 CET 2012


Hi,

I am struggling, I have 2 lists with shared elements, one ~600, one
~1000, and I need to determine the difference between them.

They are character strings, and to use setdiff(), or unique() I need
vectors. I don't know how to force these character strings into a form
where you can use functions like setdiff(). Any help would be greatly
appreciated.


> head(R1)
[1] "ccc-5-96078266-C-T" "ccc-5-96127578-C-T" "ccc-5-96133900-A-G"
"ccc-5-96145958-C-T" "ccc-5-96147966-C-T" "ccc-5-96150086-T-C"

> head(R2)
[1] "imm_5_96030100" "imm_5_96377451" "imm_5_96334858"
"imm_5_96318074" "imm_5_96356643" "imm_5_96389465"

thanks
Philip



More information about the R-help mailing list