I have datasets from cars that are measuring the state of the road at given points. However, sometimes the device will record the wrong location of where it is. (i.e. it thinks its 1km down the road when actually its 1.01km).
Firstly, if I know that one of the datasets always records where it is correctly (ground truth) how can I shift the other datasets to bring them in line in an automated way. See chart below. The red line needs to be shifted left to match the ground truth.
Secondly, if there is no ground truth how can I align a dataset that seems out when compared with the others. See chart below. It seems clear that the red line needs to be shifted left where the green and blue lines are.
Are there packages in R that could do this in a sophisticated way?