Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.