How to plot all of your Runkeeper Data

May 30, 2014   
Screen Shot 2014-05-27 at 10.50.04 PM</p>
Runs in Iowa City
2-all</p>
Running and Biking in Chicago

If you use runkeeper and pay for a yearly subscription (runkeeper elite), you can export your data and plot all of your activities simultaneously using R. I’ve written a script for doing so (Special thanks to flowing data which has a tutorial that helped with a few key parts of this).

The script does a few unique things.

  • Runkeeper exports data in gpx format. If you ever pause an activity within runkeeper or you lose GPS reception briefly, the GPS path will get split into multiple paths within the same file. The script will retain all paths and plot them separately.
  • This script will merge in the type of activities so you can plot different types of activities by color.
  • Finally, cluster analysis is used to segregate different locations when plotting. If you are like me and have moved around a bit – this is necessary as plotting distant locations on the same map (e.g. Chicago and Boston) is not feasible and results in distant locations being plotted as single points.

Directions

  1. Export your runkeeper data. The option is available for subscribers only under the settings menu.

Exporting Runkeeper Data

Exporting can be done from within the settings menu

  1. Place the script below within a folder containing your runkeeper data. Set the num_locations variable to the number of places you have lived/run. This will be used to pull out the number of distinct running locations automatically.</p>
  2. Install the necessary R packages. You can run the following code within R to do so.
<pre>install.packages("fpc") install.packages("plyr") install.packages("dplyr") install.packages("mapproj")</pre>
  1. Run the script below from within R Studio or on unix based machines using RScript plot_runkeeper.R. If you are using Rstudio, be sure to set the working directory using setwd()
Programming  R  biking gist running