I wanted to calculate the distance between two zip codes. Is there any particular function to find the distance?
I used this code
Dataframe <- transform(dataframe, Distance = ifelse(a == "" | b == "", "", georoute( c("a", "b"), verbose=TRUE, returntype="distance", service="bing" )))
Where a
and b
are two separate columns which contain zipcodes of two different areas.
I used the code given at Determing the distance between two ZIP codes (alternatives to mapdist)