I have two data sets as follows df1
and df2
. I want to merge both into one df
by matching df1$pkg
and df2$name
. But the strings in df1$pkg
and df2$name
are not exactly same. I tried using agrep
but that did not work. Will appreciate any help.
x<-agrep(df1[,2], df2[,1],ignore.case=T, value=T)
Warning message:
In agrep(df1[, 2], df2[, 1], ignore.case = T, value = T) :
argument 'pattern' has length > 1 and only the first element will be used
> x
character(0)
df1<<-data.frame(apname=c("photo eff pro", "olx", "firefox", "word search", "chrome","bbc news"),
pkg=c("bbc.mobile.news", "com.dhqsolutions", "#com.olx.olx","org.mozilla.firefox","ws.letras", "com.chrome"),
apcat=c(5,3,4,5,4,1))
df2<-data.frame(name=c("bbc.mob.news.ww", "com.dhqsolutions.enjoyphoto", "com.olx.olx","org.mozilla.firefox","ws.letras","chrome.approximated"),
tic=c(10000, 12345, 123456, 23456,9903, 12389034))