Skip to content

difference_right_join does not create distance_col when there are no overlapping rows #57

@dewoller

Description

@dewoller

difference_right_join (and probably others) do not create the designated distance_col when there are no overlapping rows. This makes use of these functions in a general pipeline problematic because the column you expect to exist does not. Example below

library(fuzzyjoin)
a <- data.frame(replicate(2,sample(20:30,10,rep=TRUE))) 

b <- data.frame(replicate(2,sample(1:10,10,rep=TRUE))) 

difference_right_join( a, b, by='X1', max_dist = 1, distance_col='distance')
#>    X1.x X2.x X1.y X2.y
#> 1    NA   NA   10    4
#> 2    NA   NA    7    5
#> 3    NA   NA    9    2
#> 4    NA   NA    1   10
#> 5    NA   NA    8    4
#> 6    NA   NA    5    1
#> 7    NA   NA    4    9
#> 8    NA   NA    1    3
#> 9    NA   NA    9    5
#> 10   NA   NA    3    6

Created on 2019-08-05 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions