dgrtwo / fuzzyjoin

Join tables together on inexact matching
Other
668 stars 61 forks source link

stringdist_inner_join fails on grouped data_frame #11

Closed sfirke closed 8 years ago

sfirke commented 8 years ago
df1 <- data_frame(color = c("yellow", "blue", "green", "purple"),
                  grp = c(1, 2, 1, 2))

df2 <- data_frame(color = c("yallow", "bloooooo", "gren", "purple"))

df1_grp <- df1 %>% group_by(grp) %>% slice(1)

stringdist_inner_join(df1, df2) # works
stringdist_inner_join(df1_grp, df2) # fails

Error: corrupt 'grouped_df', contains 2 rows, and 4 rows in groups

stringdist_inner_join(df1_grp %>% ungroup(), df2) # works with ungrouping 

I recognize the error message from dplyr bugs I have encountered, but the current CRAN version of dplyr 0.4.3 will do this join on grouped data_frames without error: inner_join(df1_grp, df2)

dgrtwo commented 8 years ago

Fixed, thanks!