[R] Help with making Loop

Hadi Fazal fazal.hadi at curie.fr
Fri May 1 22:05:22 CEST 2015

Hi everyone, 
I am a real beginner to R and have probably a very naive issue. I've a small data frame with three columns: Unique Sample ID, Gene 1 and Gene 2 (the columns on Gene1 and Gene2 are empty). I have two separate tables for the genes which contain the Unique Subject ID in one column and information on whether the gene is mutated or not in that particular subject (M, N/M) in another column called (Condition). I want to make a loop which can read the Unique Subject ID from my data frame, then look up for the same ID in the two tables and depending on whether the gene is mutated (M)/not mutated (N/M), inserts Yes like emoticon / No (N) in the appropriate gene column (Gene1/Gene2) for each Subject ID.
If anyone can help, I would really appreciate
Thanks in advance

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Gene2.png
Type: image/png
Size: 6717 bytes
Desc: Gene2.png
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150501/dc7de010/attachment.png>

More information about the R-help mailing list