What 5,728.986 miles look like…

November 10, 2011
By

(This article was first published on ProcRun; » R, and kindly contributed to R-bloggers)

Time Series as calendar heat maps + All of my running data since April 1, 2009 =

Generated by the following code:

#Sample Code based on example program at:
source(file = "calendarHeat.R")

run<- read.csv("log.csv", header = TRUE, sep=",")
sum(run$Distance)

date <- c()

for (i in 1: dim(run)[1]){

    if(run$DistanceUnit[i]== 'Kilometer'){
      miles <- c(miles,run$Distance[i] * 0.62)
    }
    else{
      miles <- c(miles,run$Distance[i])
    }
}
sum(miles)

calendarHeat(run$Date, miles, varname="Andy's Running Mileage")

You can see the definite shift in the length of my daily runs over the past 12 months.  Race times have dropped a chunk over that same period.

The heat map still needs some cleaning up,  using 26.2 as the max intensity is preventing the differences in my shorter runs from coming through.  Capping it at max of 15 (shortest of my ‘long’ runs) is probably a good idea to further show the shift in my daily mileage.

One of these days I need to transfer the 4,534.62 miles I have logged into notebooks to the computer.   Buying a Garmin Forerunner and having the data automatically updated to Runningahead.com  made it super easy to get the dataset.

Full code and source files are available on bitbucket:  RunningHeatMap

To leave a comment for the author, please follow the link and comment on his blog: ProcRun; » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.