I have to following data frame.
x1 x2 x3
0 58.33546 15.14554
0 58.33604 15.14571
0 58.33645 15.14581
0 58.33681 15.14591
0 58.33722 15.14600
0 58.33810 15.14604
0 58.33900 15.14599
0 58.33966 15.14578
Consisting of long and lat, each pair belongs to a string (0,1,3,4 and so on, only the string 0 is displayed above).
I would like to first construct a new column with the pairs (x2,x3). How do I do that?
The coordinates above corresponding to 0 is actually a journey (say X), if there is another journey (Y) whose first coordinate is the same as X last, I would like to merge the sequence X and Y coordinates together and call that journey X (the continuation of X simply).
My data set is called data, for some reason merging them together wont work with
data[, x4 := paste(data$x2, data$x3)]
This will create a new column, only isplaying x2.