Skip to content

Instantly share code, notes, and snippets.

# Load packages
library(tidyverse)
library(vroom)
library(gt)
library(gtExtras)
# read in full l2m data
dat <- vroom("https://raw.githubusercontent.com/atlhawksfanatic/L2M/master/1-tidy/L2M/L2M.csv")
# count total games requiring an L2M for each team in 2023 -- we'll use this later
@Henryjean
Henryjean / EPA per play diamond plot
Created October 18, 2022 13:10
Make a diamond plot from EPA per play data (colorblind friendly)
library(tidyverse)
library(nflplotR)
library(nflreadr)
# need this for rotation and saving
library(grid)
# need this for labels
library(ggtext)
# data loading and wrangling copied from: https://www.nflfastr.com/articles/beginners_guide.html#figures-with-qb-stats
# get pbp and filter to regular season rush and pass plays
library(tidyverse)
library(nflplotR)
library(nflreadr)
library(grid)
library(ggtext)
# data loading and wrangling copied from: https://www.nflfastr.com/articles/beginners_guide.html#figures-with-qb-stats
# get pbp and filter to regular season rush and pass plays
pbp <- nflreadr::load_pbp(2022) %>%
dplyr::filter(season_type == "REG" & week == 1) %>%
library(tidyverse)
library(gt)
# create data
df <- data.frame(
stringsAsFactors = FALSE,
player = c("Evan Mobley",
"Sandro Mamukelashvili","Charles Bassey","Luka Garza",
"Moses Wright","Neeimisa Queta",
"Isaiah Jackson","Day'Ron Sharpe"),