hello all i have one silly question related to R i have two files file1 :-
V1 V2 V3
exon Rv0001 CCP42723
exon Rv0002 CCP42724
total rows in file 1 is 4110
file2 :
id Gene_name
1 CCP42723
2 CCP42724
total rows in file 2 is 4114
i want to match column V3 of file1 and column Gene_name of file2 and my output file should only contain column V2 of file1 . Means if my 1strow of file1 and 2 are matching it should give output of V2 first row of file2 in new file. my new file will only have V2 column of file1 which shows matching
i tried for loop but it seems i m going wrong file3$Gene_name <- 0 for (i in 1:4110) { file_new_id = file2[file2$V3 %in% file3[i,2],]$V2 } any help highly appreciated thanks
Dont use
for
usemerge
then extract the require columnOr, import dplyr and use
select