Skip to content

Instantly share code, notes, and snippets.

@Tafkas
Created December 9, 2013 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tafkas/7872978 to your computer and use it in GitHub Desktop.
Save Tafkas/7872978 to your computer and use it in GitHub Desktop.
Some charts of the St. Pat's 10 Miler and 5K 2008
data <- read.csv(file = "2008TenMiler.csv", header = TRUE, sep=",")
summary(data)
data <- na.omit(data)
#convert time to minutes
data$Nettime <- as.character(data$Nettime)
data$Nettime <- sapply(strsplit(data$Nettime, ":"),
function(x) {
x <- as.numeric(x)
x[1]*60 + x[2] + x[3]/60
}
)
men <- data[data$Sex == "M",]
women <- data[data$Sex == "F",]
library(ggplot2)
p <- ggplot(data, aes(Age, Nettime, color=Sex)) + theme_bw()
p <- p + geom_point(shape = 19) + geom_smooth(method=loess, se=FALSE, fullrange=T) + scale_colour_hue(l=50)
p <- p + ggtitle("Age vs. Time at the Atlantic City 10 Miler") + ylab("Time in Minutes") + xlab("Age in Years")
p
p <- ggplot(data, aes(Nettime, fill=Sex)) + theme_bw()
p <- p + geom_histogram(binwidth=5, colour="black")
p + ggtitle("Net Time Distribution at the Atlantic City 10 Miler") + ylab("Number of Runners") + xlab("Net Time in Minutes")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment