I have a dataframe as follow:
X1 X2
6.134811 49.58038
6.135331 49.58127
6.135670 49.58170
6.134905 49.58199
I would like to create a new variable X3 where will be computed the distance in meters between each sequence of GPS points. The 1st row can be 0, then on the second row will be the distance between 1st & 2nd row, on the 3rd row will be the distance between 2nd & 3rd row and so on, as follow:
X1 X2 X3
6.134811 49.58038 0
6.135331 49.58127 114
6.135670 49.58170 61
6.134905 49.58199 90
Any ideas on how to solve this would be greatly appreciated!