sql - find partial match between two data frame -
i have 2 data frames.
head(neexp) gene transcript ratio_log2 fdr hlhmgamma hlhmgamma-ra 3.759200 1.09e-10 brd brd-ra 3.527000 2.66e-08 cg4080 cg4080-re 3.378500 2.95e-50 rpii215 rpii215-ra 3.343967 1.82e-10 head(excel$gene) enhancer of split mgamma, helix-loop-helix distal antenna cg4080 gene product transcript cg4080-rb as can see, 2 gene column match partially(hlhmgamma matches enhancer of split mgamma, helix-loop-helix; cg4080 matches cg4080 gene product transcript cg4080-rb), there anyway can link these two? codes have tried far:
genename=as.character(neexp$gene) query=paste("select * excel excel.gene \"", genename,"\ ",sep"") newtable<-dbgetquery(con,query) dbgetquery(con,"select * excel, neexp excel.gene % "neexp$gene" %")
you need merge , same join in sql. first might want split excel$gene part want match.
http://stat.ethz.ch/r-manual/r-devel/library/base/html/merge.html
https://stat.ethz.ch/r-manual/r-devel/library/base/html/strsplit.html
Comments
Post a Comment