This project uses data from the Pro Football Reference website. Web scraping will be done to retrieve statistics data for all the recievers in the NFL last season.I will looking to answer what teams had the overall best recieving core through a series of different analyses. The packages that will be used are listed below. The overall goal is to see which recieving core in the NFL AFC East performed best in the 2020-2021 season.
library(XML) # Working with XML table objects on HTML webpages
library(tidyverse) # The tidyverse collection of packages
library(httr) # Useful for web authentication
library(rvest) # Useful tools for working with HTML and XML
library(DT) #This package is used to create javascript data tables. This was an easy option to ouput all my cleaned data into readable table.
In order to load my data, I created an entity reference that contains the pro football reference web adress. I made sure the correct data will be collected by checking the header. Then, the entire HTTPS page had to be downloaded. Tables were then stored and then checked for how many are present. One table was recorded and turned into a usable data frame.
Listed below is each varibale included in the data set and a description of what each one means. The entire data set is also below for reference.
| Variable | Description |
|---|---|
| Rk | Overall Ranking |
| Player | Player Namee |
| Tm | Team Name |
| Age | Age in Years |
| Pos | Position Played |
| G | Games Played |
| GS | Games Started |
| Tgt | Targets |
| Rec | Receptions |
| Ctch. | Catch Percentage |
| Yds | Total Yards |
| Y.R | Yards per Recpetion |
| TD | Total Touchdowns |
| X1D | First Downs Recieving |
| Lng | Longest Single Reception |
| Y.Tgt | Yards per Target |
| R.G | Receptions per Game |
| Y.G | Yards per Game |
| Fmb | Total Fumbles |
The position played column had multiple blanks. I replaced all the blank columns with “NA” to help prevent errors in future analysis. Also, multiple rows contained variable names and had to be removed from the data set.
performance$Pos <- replace(performance$Pos,performance$Pos== "", NA)
performance <- performance[!grepl("Player", performance$Player),]
The Buffalo Bills had the lowest total receiving yards in the AFC East last season, despite having the best record. I will look later on to see which recievers were leaders in total yards last season. It is possible that the Bills had a much better run game than the other AFC East teams. The Jets, having the second lowest record in the NFL, were second in total receiving yards.
The Buffalo Billas had the most overall receiving TDs last season. The New England Patriots had the least. THe rankings match up exact to the order of records of each team last season. Therefore, scoring more will quite clearly earn a team more wins and translates to the Bills success last season.
The table below displays the players in the AFC East who were leaders in Touchdowns scored. The bills reciever Stefon Diggs was in a league of his own in terms of recieving yards and led the East with 8 touchdowns. Four bills recievers were in the top 6 for TDs scored. The bills are the only AFC East team with two recievers over 900 yards recieving, Diggs and Bealsey. Although, as seen above, the Bills had the least total receiving yards as a team in the AFc East.
Josh Allen, the quarterback for the Buffalo Bills, led the AFC East in fumbles. The bills in total had the most fumbles last year in the AFC East. It is a clear issue they need to address as a team in order to win more games. Turnovers are a costly mistake and decide the outcome of many games.
## Tm Player Fmb
## 1 BUF Josh Allen * 9
## 2 NWE Cam Newton 6
## 3 NWE Damiere Byrd 3
## 4 BUF Andre Roberts* 3
## 5 MIA Myles Gaskin 2
## 6 MIA Jakeem Grant 2
## 7 NYJ Chris Herndon 2
## 8 BUF Dawson Knox 2
## 9 MIA Matt Breida 2
## 10 MIA Ryan Fitzpatrick 2
The Buffalo Bills were clearly the best team last season in the AFC East. But, teams such as the Jets can be hopeful for the upcoming season due to their above anticipated passing performance. What is all comes down to though is scoring. Touchdowns are absoultely neccesary to win games and all other offensive performanc stats come second. Further analysis that can be done is testing for the correlation between the above visuals to get an actual number that represents performance based on multiple team statistics. It would require additional data of last years team records to be pulled in.