I have the following dataframe with 1051 observations.
customer_id long lat
11111 111.320 110.574
11112 111.243 110.311
I need to manipulate the dataframe so that every observation is matched up with every observation. This will allow me to get the distance between each observation.
customer_id_a long_a lat_b customer_id_b long_a lat_b
11111 111.320 110.574 11112 111.243 110.311
In R, how do I do this?