R 使用公共字按行合并两个数据帧 df1

R 使用公共字按行合并两个数据帧 df1,r,quanteda,R,Quanteda,也许,您可以从fuzzyjoin查看stringdist连接,并使用适合您的数据的max_dist参数 df3 <- data.frame(freetext = c("open until night", "one time to insert your be"), aid = c(3,5), numid = c(291,312)) fuzzyjoin::stringdist\u-internal\u-join(df1,df2,by='freete

也许,您可以从
fuzzyjoin
查看
stringdist
连接,并使用适合您的数据的
max_dist
参数

df3 <- data.frame(freetext = c("open until night", "one time to insert your be"), aid = c(3,5), numid = c(291,312))
fuzzyjoin::stringdist\u-internal\u-join(df1,df2,by='freetext',max\u-dist=10)
#freetext.x numid freetext.y aid
#                                                      
#1开到周一晚上291开到晚上3
#2再插入一次硬币312再插入一次be 5
Dupe-oids:;
df3 <- data.frame(freetext = c("open until night", "one time to insert your be"), aid = c(3,5), numid = c(291,312))
fuzzyjoin::stringdist_inner_join(df1, df2, by = 'freetext', max_dist = 10)

#  freetext.x                        numid freetext.y                   aid
#  <chr>                             <dbl> <chr>                      <dbl>
#1 open until monday night             291 open until night               3
#2 one more time to insert your coin   312 one time to insert your be     5