How to calculate Manhattan distance in R

Want to calculate distance on “cordinate” column.

result like every distance against every user

Its better u do a cross join of all rows and as manhattan distance has formula:
|x1 – x2| + |y1 – y2|
use the coordinates to calculate the same .

1 Like

Thank you, it will be more help full, kindly tell me how to cross join in one sheet.

https://www.contextures.com/excelmsquerycartesian.html

i hope the below link helps … or u can also use sql with python for cross join if u want to explore sql and python together …

© Copyright 2013-2019 Analytics Vidhya