Load Packages and CSV

Since PFF won’t allow me to filter rookies, I am forced to fill in a csv manually Only added players with >= 4 man targets

receiving_scheme <- read.csv("receiving_scheme.csv")
library(ggplot2)
library(ggrepel)
library(nflplotR)
## Warning: package 'nflplotR' was built under R version 4.4.3
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.4.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ lubridate 1.9.3     ✔ tibble    3.2.1
## ✔ purrr     1.0.2     ✔ tidyr     1.3.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

Plot The Data

plot <- receiving_scheme %>% ggplot(aes(x=man_grade, y=man_yprr)) + geom_vline(xintercept = mean(ifelse(receiving_scheme$position == "WR" & receiving_scheme$man_tgt >= 4, receiving_scheme$man_grade, NA), na.rm = TRUE), color = "red", linetype = "dashed") + geom_hline(yintercept = mean(ifelse(receiving_scheme$position == "WR" & receiving_scheme$man_tgt >= 4, receiving_scheme$man_yprr, NA), na.rm = TRUE), color = "red", linetype = "dashed") + geom_text_repel(aes(label = player), vjust = -0.5, hjust = 0.5, size = 2, max.overlaps = 20) + scale_size_continuous(range = c(2, 4)) + geom_nfl_logos(aes(team_abbr = team), width = 0.02) + ylab("YPRR vs Man") + xlab("Receiving Grade vs Man (PFF)") + labs(caption = "Data: PFF") + theme(plot.caption = element_text(size = 10, hjust = 1, vjust = 1, color = "gray40"))
plot