Skip to content

Instantly share code, notes, and snippets.

@gallochris
gallochris / fta-fc-per-40.md
Last active November 10, 2016 20:23
UNC free throw attempts and fouls committed per 40 minutes
Player Games FTA Minutes Played FTA per 40 Fouls Committed FC per 40
Tyler Hansbrough 142 1241 4394 11.30 348 3.17
Sean May 77 459 2139 8.58 188 3.52
Marvin Williams 36 163 800 8.15 92 4.60
Tyler Zeller 117 525 2696 7.79 295 4.38
James Michael McAdoo 108 524 2696 7.77 229 3.40
Ty Lawson 105 432 2835 6.10 205 2.89
ISAIAH HICKS 112 229 1535 5.97 251 6.54
Harrison Barnes 75 319 2198 5.81 140 2.55
@gallochris
gallochris / unc-fta-opp-ft.md
Last active October 30, 2019 14:29
UNC free throw attempts versus opponents' made free throws
Year UNC Made FTs Opponent Attempted FTs
2004 515 597
2005 724 689
2006 519 522
2007 669 646
2008 738 641
2009 739 627
2010 558 585
2011 590 580
@gallochris
gallochris / defeats.csv
Last active August 16, 2019 20:52
losses by margin of defeat in RW Era
Season Date Opponent Result UNC Score Opponent Score MOD Overtime? Location Type
2012 14-Jan-12 Florida State L 57 90 -33 away League -7
2010 6-Mar-10 Duke L 50 82 -32 away League
2013 9-Feb-13 Miami L 61 87 -26 away League
2013 27-Nov-12 Indiana L 59 83 -24 away Non-Conference
2010 7-Feb-10 Maryland L 71 92 -21 away League
2019 12-Jan-19 Louisville L 62 83 -21 home League
2011 16-Jan-11 Georgia Tech L 58 78 -20 away League
2018 18-Mar-18 Texas A&M L 65 85 -20 neutral NCAA Tournament 2nd Round
2010 13-Jan-10 Clemson L 64 83 -19 away League
@gallochris
gallochris / double.csv
Last active August 16, 2019 20:53
double-digit-losses by season in RW Era
Season Num
2004 1
2005 2
2006 2
2007 1
2008 2
2009 0
2010 11
2011 3
2012 3
@gallochris
gallochris / spread_losses.csv
Created August 16, 2019 19:58
point spreads and double-digit losses in RW ERa
Season Opponent Result UNC Score Opp Score Favored by? Lost by? Swing?
2011-12 Florida State L 57 90 -6 -33 -39
2018-19 Louisville L 62 83 -11 -21 -32
2016-17 Georgia Tech L 63 75 -17 -12 -29
2017-18 Texas A&M L 65 85 -7 -20 -27
2010-11 Georgia Tech L 58 78 -6 -20 -26
2004-05 Santa Clara L 66 77 -13 -11 -24
2009-10 UVA L 60 75 -8 -15 -23
2012-13 Texas L 67 85 -4.5 -18 -22.5
2005-06 Miami L 70 81 -10.5 -11 -21.5
@gallochris
gallochris / win_total_roy_era.csv
Last active January 30, 2020 22:16
win totals first 20 games roy era
G W Product
1 1 2004
2 2 2004
3 3 2004
4 4 2004
5 5 2004
6 6 2004
7 6 2004
8 7 2004
9 8 2004
@gallochris
gallochris / duke-unc-point-spreads.md
Last active February 5, 2020 19:38
duke-unc-point-spreads
Season Result UNC Score Opp Score Ref 1 Ref 2 Ref 3 Spread Location
2019 L 73 74 Roger Ayers Jamie Luckie Clarence Armstrong 3.5 neutral
2019 W 79 70 Roger Ayers Ted Valentine Bill Covington Jr. -4.5 home
2019 W 88 72 Mike Eades Brian Dorsey Ron Groover 9.5 away
2018 W 74 69 Mike Eades Ted Valentine Bert Smith 4 neutral
2018 L 64 74 Roger Ayers Mike Eades Raymond Styons 7.5 away
2018 W 82 78 Jeff Clark Jamie Luckie Ron Groover -1.5 home
2017 L 83 93 Bria
@gallochris
gallochris / minutes_2019_2020.r
Created October 20, 2020 15:38
2019-20 Minutes played UNC
library(tidyverse)
library(gt)
# make the data
injury <- tibble::tribble(
~Opp,~Anthony,~Keeling,~Robinson,~Black,~Brooks,~Bacot,~Pierce,~Platek,~Francis,~Harris,~Manley,
"Notre Dame",37,21,0,33,39,23,20,26,0,0,0,
"at UNC-Wilmington",34,23,0,32,33,3,32,27,0,0,0,
"Gardner-Webb",33,30,0,34,30,23,21,23,0,0,0,
"Elon",36,25,0,27,33,26,23,18,0,0,0,
@gallochris
gallochris / win_totals_odds_2021-22.R
Created September 29, 2021 15:39
WynnBet win totals, title odds, and final four odds
library(tidyverse)
library(gt)
# make the data - https://www.wynnbet.com/theplaybook/posts/wynnbet-releases-odds-for-upcoming-men-s-college-basketball-season-01ffk34jmvek
odds <- tibble::tribble(
~team, ~win, ~nt, ~ff,
"Gonzaga", 33.5, 11.1, 33.3,
"UCLA", 31, 7.7, 25.0,
"Michigan", 27, 7.7, 25.0,
"Memphis", 32, 6.3, 20.0,
library(rvest)
library(dplyr)
library(janitor)
library(stringr)
# load data
url <-
'https://www.sports-reference.com/cfb/play-index/sgl_finder.cgi?request=1&match=game&year_min=2019&year_max=2021&school_id=north-carolina&c1stat=points&c1comp=gt&c1val=1&c2stat=opp_points&c2comp=gt&c2val=1&c3comp=gt&c4comp=gt&order_by=date_game#results'
mack_raw <- url %>%