Re: [R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Bogdan Tanasa
it looks great, thank you very much Jeff for your time and kind help ! On Wed, Jul 18, 2018 at 7:51 PM, Jeff Newmiller wrote: > The traditional (SQL) way to attack this problem is to make the data > structure simpler so that faster comparisons can be utilized: > > > A <-

Re: [R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Jeff Newmiller
The traditional (SQL) way to attack this problem is to make the data structure simpler so that faster comparisons can be utilized: A <- data.frame(z=c("a*b", "c*d", "d*e", "e*f"), t =c(1, 2, 3, 4)) B <- data.frame(z=c("a*b::x*y", "c", "", "g*h"), t =c(1, 2, 3, 4))

Re: [R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Bogdan Tanasa
Dear Riley, thank you very much for your help and solution. I got some inspiration from stackoverflow website, and I did use sqldf library. It looks that the formula below works too. Thanks a lot ! sqldf("select B.*, A.* from B left join A on instr(B.z, A.z)") On Wed, Jul 18, 2018 at 3:57

Re: [R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Bogdan Tanasa
Thanks a lot ! It looks that I am getting the same results with : B %>% regex_left_join(A, by = c(z = 'z')) On Wed, Jul 18, 2018 at 3:57 PM, Riley Finn wrote: > please may I ask for a piece of advise regarding merging two dataframes : >> A <- data.frame(z=c("a*b", "c*d", "d*e", "e*f"), t =c(1,

[R] help with merging two dataframes function of "egrep"-like formulas

2018-07-18 Thread Bogdan Tanasa
Dear all, please may I ask for a piece of advise regarding merging two dataframes : A <- data.frame(z=c("a*b", "c*d", "d*e", "e*f"), t =c(1, 2, 3, 4)) B <- data.frame(z=c("a*b::x*y", "c", "", "g*h"), t =c(1, 2, 3, 4)) function of the criteria : if "the elements in the 1st column of A could be