Sep
18
Stay on track: Plotting GPS tracks with R
Many GPS devices and apps have the capability to track your current position via GPS. If you go walking, running, cycling, flying or driving, you can take a look at your exact route and your average speed.
Some of these devices or apps also allow you to export your routes in various formats, e.g., the popular XML-based GPX format.
I want to show you my attempts to
- read in a GPX file using R and its XML package,
- calculate distances and speeds between points,
- plot elevation and speed,
- plot a track,
- plot a track on a map.
Here are the results. Everything below the plots shows you how to do it in R. Drop me a comment if you have any questions.
The altitude of the track in time, with smoother. Click to enlarge.
The speed during the run, with smoother. Click to enlarge.
Some of these devices or apps also allow you to export your routes in various formats, e.g., the popular XML-based GPX format.
I want to show you my attempts to
- read in a GPX file using R and its XML package,
- calculate distances and speeds between points,
- plot elevation and speed,
- plot a track,
- plot a track on a map.
Here are the results. Everything below the plots shows you how to do it in R. Drop me a comment if you have any questions.
The altitude of the track in time, with smoother. Click to enlarge.
The speed during the run, with smoother. Click to enlarge.