We’ve not all been in the same room for a such a long time! Let’s
make sure that the tidy
toolkit is still at our
fingertips.
Some nice NFL game by game player data (t0
) and some
salary data (t1
)
library(tidyverse)
library(nflreadr)
library(magrittr)
t0 <- load_player_stats(
seasons = T,
stat_type = "offense"
)
t1 <- load_contracts()
Among Quarterbacks and Running Backs, report the player who had the highest regular season passing or rushing (respectively), by season.
Again, among Quarterbacks and Running Backs and only during the regular season, summarize the total number of passing and rushing touchdowns (again respectively by position.) Consider the year to year change in these touchdowns–specifically, by position, report the player who had the largest total year to year increase in touchdowns. Then report the largest total decrease, again by position.
Take the contract table t1
and summarize inflation
adjusted salaries by draft position. Restrict the analysis to four
offensive positions (Quarterbacks, Running Backs, Wide Receivers, and
Left Tackles), and one defensive position (Edge Rushers). Report a table
for every first round draft position (so, 1 through 32), where columns
are the named positions, and cell entries are the highest paid player
for that position and draft order pair.