zipcodeR icon indicating copy to clipboard operation
zipcodeR copied to clipboard

zip_distance with vectors not returning correct order of results

Open ghost opened this issue 3 years ago • 0 comments

Using the example given in the README: #> zipcode_a zipcode_b distance #> 1 08731 08901 6.9 #> 2 08734 08005 45.1`

You can check a map to verify that the distances for the two pairs of zipcodes is swapped. 08731 > 08901 is actually 45mi, while 08734 > 08005 is 7mi.

You can see it more distinctly using the same repeated values: zip_distance( zipcode_a = c('08731', '08731'), zipcode_b = c('08731', '08005') )

zipcode_a zipcode_b distance 08731 08731 6.9 08731 08005 0.0

They are also in the wrong order for multiple rows n > 2.

ghost avatar Jan 14 '22 01:01 ghost