For this homework, my goal was to analyze and accurately show the number of Super Bowl wins from each division. Through this visualization, my hope was to portray which division was historically the “best” and then draw conclusions based on previous events. I first imported the data set, nfl_standings and chose the three variables I wanted to utilize. Those three variables are as follows:
I was able to use the geom_col() to visualize the above intended result. I also utilized ggtitle() to title my graphic, xlab() to name my x-axis variable, ylab() to name my y-axis values, and labs() to properly name my legend.
nfl_standings <- readr::read_csv("standings.csv")
nfl_standings
## # A tibble: 638 x 17
## team division year wins loss points_for points_against points_differen~
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Miam~ AFC East 2000 11 5 323 226 97
## 2 Indi~ AFC Sou~ 2000 10 6 429 326 103
## 3 New ~ AFC East 2000 9 7 321 321 0
## 4 Buff~ AFC East 2000 8 8 315 350 -35
## 5 New ~ AFC East 2000 5 11 276 338 -62
## 6 Tenn~ AFC Sou~ 2000 13 3 346 191 155
## 7 Balt~ AFC Nor~ 2000 12 4 333 165 168
## 8 Pitt~ AFC Nor~ 2000 9 7 321 255 66
## 9 Jack~ AFC Sou~ 2000 7 9 367 327 40
## 10 Cinc~ AFC Nor~ 2000 4 12 185 359 -174
## # ... with 628 more rows, and 9 more variables: margin_of_victory <dbl>,
## # strength_of_schedule <dbl>, simple_rating <dbl>, offensive_ranking <dbl>,
## # defensive_ranking <dbl>, playoffs <chr>, sb_winner <chr>,
## # bin_playoffs <dbl>, bin_sb <dbl>
library(ggplot2)
ggplot(data = nfl_standings,
aes(division, bin_sb, col = team)) + geom_col() +
ggtitle("Super Bowl Winners by Division") +
xlab("Division") + ylab("Count of Super Bowl Championships Won") +
labs(col = "Team Name")
As evident in the above visualization created used the ggplot2 package, the AFC East has had the most Super Bowl wins between 2000-2019. This can be largely attributed to the New England Patriots’ former quarterback Tom Brady and current head coach Bill Belichick bringing home championships in 2002, 2004, 2005, 2015, 2017, and 2019. Additionally, the second-best division appears to be the AFC North, with both the Pittsburgh Steelers and Baltimore Ravens winning at least one Super Bowl Championship each.
Conversely, it appears the AFC South, NFC North, and NFC West have all only won one Super Bowl over the past two decades. Using the ggplot2 package, I was able to effectively create and interpret a visualization, and I look forward to learning more ways to manipulate my data sets. Using the ggplot feature, I will be able to use a variety of geoms such as geom_bar, geom_histogram, and geom_point, among others moving forward.