library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── 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
library(DT)
## Warning: package 'DT' was built under R version 4.4.3
qb_stats_total <- read.csv("qb_stats_total.csv")
rb_stats_total <- read.csv("rb_stats_total.csv")
wr_stats_total <- read.csv("wr_stats_total.csv")
te_stats_total <- read.csv("te_stats_total.csv")
ot_stats_total <- read.csv("ot_stats_total.csv")
iol_stats_total <- read.csv("iol_stats_total.csv")
dl_stats_total <- read.csv("dl_stats_total.csv")
ed_stats_total <- read.csv("ed_stats_total.csv")
lb_stats_total <- read.csv("lb_stats_total.csv")
cb_stats_total <- read.csv("cb_stats_total.csv")
s_stats_total <- read.csv("s_stats_total.csv")
combine all of the position datasets into one big total dataset and sort by score
combined_rankings <- bind_rows(qb_stats_total, rb_stats_total, wr_stats_total, te_stats_total, ot_stats_total, iol_stats_total, dl_stats_total, ed_stats_total, lb_stats_total, cb_stats_total, s_stats_total)
combined_rankings <- combined_rankings %>%
arrange(-total) %>%
rename(rank_bef = rank) %>%
mutate(rank_aft = row_number(), rank_diff = rank_bef-rank_aft) %>%
select(player, total, pos, team, rank_bef, rank_aft, rank_diff, pos_rank_bef, pos_rank_aft, pos_rank_diff)
write.csv(combined_rankings, "combined_rankings.csv", row.names = FALSE)
datatable(combined_rankings)