ICW2
✓ Published0🌍 Public
NN0taN3rd
Last edited Feb 3, 2016
Created on Feb 2, 2016
This gallery example presents visualizations of 2014 college football passing statistics from a CSV file. The scatter matrix uses R's `pairs` function to plot combinations of passing yards, touchdowns, quarterback rating, and rushing stats. A bar chart using `ggplot2` with `geom_bar` displays passing yards per player, while another `ggplot2` bar chart shows average rushing touchdowns per conference, computed with the `aggregate` function. All charts are rendered as SVG.
AI-generated descriptionJohn Berlin ICW2 Group Members: John Berlin
Scatter Matrix

setwd(getwd())
playerStats <- read.csv('passing-stats-2014.csv')
pairs(~playerStats$Passing.Yards+playerStats$Passing.TD+playerStats$Rate+playerStats$Rushing.Yards+playerStats$Rushing.TD)
Yards Per Player

library(ggplot2)
setwd(getwd())
playerStats <- read.csv('passing-stats-2014.csv')
yardsConf = data.frame(yrds=playerStats$Passing.Yards,player=playerStats$Player,conf=playerStats$Conf)
ggplot(yardsConf,aes(x=player,y=yrds,fill=conf)) + geom_bar(stat="identity") + coord_flip()
Average Rushing TD

library(ggplot2)
setwd(getwd())
playerStats <- read.csv('passing-stats-2014.csv')
two <- playerStats[, c("Conf","Rushing.TD")]
ret <- aggregate(two,by=list(two$Conf),FUN="mean")
present <- data.frame(Conf=ret$Group.1,Av.Russing.TD=ret$Rushing.TD)
ggplot(present,aes(x=Conf,y=Av.Russing.TD,fill=Conf)) + geom_bar(stat="identity")