Skip to content

Instantly share code, notes, and snippets.

View gist:9ee74101128c0ef7aa2f6a6fd0ec3323
library(tidyverse)
library(dplyr)
library(na.tools)
library(ggimage)
library(hrbrthemes)
library(viridis)
theme_tej <- function() {
theme(text = element_text(family='Tahoma', color="#232D4B"), # set font and color of all text
plot.title = element_text(size = 20, hjust = 0.5, face = "bold"),
View gist:681a0d3bf68a1ddc64ade32cf320d192
library(tidyverse)
library(ggrepel)
library(ggimage)
library(ggtext)
library(mgcv)
library(scales)
library(ggforce)
library(nflfastR)
library(na.tools)
library(bayesboot)
View gist:50ef14c04e9a3663045701171310592c
library(tidyverse)
library(xgboost)
library(magrittr)
library(dplyr)
library(Matrix)
library(na.tools)
library(ggimage)
library(nflfastR)
library(gt)
library(mgcv)
View gist:752a72fbcaf5b701a020963ae1e9a272
library(tidyverse)
library(gganimate)
library(mvtnorm)
team_ <- "DET"
qb_ <- "M.Stafford"
min_offense_play_result <- 25
stafford_play <- df_plays %>%
dplyr::filter(possessionTeam == team_,
View gist:f34eb135e4043c12c3549c05265ea741
ridges <- df_plays_cov %>%
filter(epa > -2) %>%
filter(epa < 2)
ggplot(ridges, aes(x = epa, y = most_freq_cov, fill = most_freq_cov)) +
geom_density_ridges() +
theme_ridges() +
labs(x = "EPA Allowed",
y = "Coverage",
title = "EPA Ridge for Each Coverage",
caption = "By Tej Seth | @mfbanalytics | Data from the Big Data Bowl") +
View gist:fad3f91601e0a9905168863950b90db2
cov_stats <- cov_stats %>%
mutate(freq = plays / 14575)
#Creating a table
cov_table <- cov_stats %>%
gt() %>%
tab_header(
title = "2018 Coverage Statistics",
subtitle = "Coverages were assigned based on random forest classification"
) %>%
View gist:529f82138f06585db7aeeaf621f10c76
library(tidyverse)
library(gganimate)
library(cowplot)
library(repr)
library(grid)
library(gridExtra)
library(rpart)
library(rpart.plot)
library(caret)
library(e1071)
View gist:4653275d30e9cf50e9ffcacd07010858
library(tidyverse)
library(nflfastR)
library(ggplot2)
library(dplyr)
library(hrbrthemes)
library(ggrepel)
library(ggimage)
games <- readRDS(url("http://www.habitatring.com/games.rds"))
View gist:947f468661d91ca8d69e2e8d7f1daea5
#install.packages("tidyverse")
#install.packages("forcats")
#install.packages("hrbrthemes")
#install.packages("viridis")
#install.packages("ggrepel")
#Take out the '#' when installing the packages. I only included that in case you've already installed them.
#Tidyverse is the main one you need and the others are just for design.
library(tidyverse)