Skip to content

Instantly share code, notes, and snippets.

@gallochris
Last active January 30, 2020 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gallochris/efbac9aaaf312389e7f693fe7cd2277b to your computer and use it in GitHub Desktop.
Save gallochris/efbac9aaaf312389e7f693fe7cd2277b to your computer and use it in GitHub Desktop.
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
10 8 2004
11 9 2004
12 10 2004
13 10 2004
14 11 2004
15 11 2004
16 12 2004
17 13 2004
18 13 2004
19 13 2004
20 14 2004
1 0 2005
2 1 2005
3 2 2005
4 3 2005
5 4 2005
6 5 2005
7 6 2005
8 7 2005
9 8 2005
10 9 2005
11 10 2005
12 11 2005
13 12 2005
14 13 2005
15 14 2005
16 14 2005
17 15 2005
18 16 2005
19 17 2005
20 18 2005
1 1 2006
2 2 2006
3 3 2006
4 3 2006
5 4 2006
6 5 2006
7 6 2006
8 6 2006
9 7 2006
10 8 2006
11 9 2006
12 10 2006
13 10 2006
14 10 2006
15 11 2006
16 11 2006
17 12 2006
18 13 2006
19 14 2006
20 14 2006
1 1 2007
2 2 2007
3 3 2007
4 3 2007
5 4 2007
6 5 2007
7 6 2007
8 7 2007
9 8 2007
10 9 2007
11 10 2007
12 11 2007
13 12 2007
14 13 2007
15 14 2007
16 15 2007
17 15 2007
18 16 2007
19 17 2007
20 18 2007
1 1 2008
2 2 2008
3 3 2008
4 4 2008
5 5 2008
6 6 2008
7 7 2008
8 8 2008
9 9 2008
10 10 2008
11 11 2008
12 12 2008
13 13 2008
14 14 2008
15 15 2008
16 16 2008
17 17 2008
18 18 2008
19 18 2008
20 19 2008
1 1 2009
2 2 2009
3 3 2009
4 4 2009
5 5 2009
6 6 2009
7 7 2009
8 8 2009
9 9 2009
10 10 2009
11 11 2009
12 12 2009
13 13 2009
14 13 2009
15 14 2009
16 14 2009
17 15 2009
18 16 2009
19 17 2009
20 18 2009
1 1 2010
2 2 2010
3 3 2010
4 4 2010
5 4 2010
6 5 2010
7 6 2010
8 7 2010
9 7 2010
10 8 2010
11 8 2010
12 9 2010
13 10 2010
14 11 2010
15 11 2010
16 12 2010
17 12 2010
18 12 2010
19 12 2010
20 13 2010
1 1 2011
2 2 2011
3 2 2011
4 2 2011
5 3 2011
6 4 2011
7 4 2011
8 5 2011
9 6 2011
10 7 2011
11 7 2011
12 8 2011
13 9 2011
14 10 2011
15 11 2011
16 12 2011
17 12 2011
18 13 2011
19 14 2011
20 15 2011
1 1 2012
2 2 2012
3 3 2012
4 4 2012
5 5 2012
6 5 2012
7 6 2012
8 6 2012
9 7 2012
10 8 2012
11 9 2012
12 10 2012
13 11 2012
14 12 2012
15 13 2012
16 14 2012
17 15 2012
18 15 2012
19 16 2012
20 17 2012
1 1 2013
2 2 2013
3 3 2013
4 4 2013
5 4 2013
6 5 2013
7 5 2013
8 6 2013
9 7 2013
10 8 2013
11 8 2013
12 9 2013
13 10 2013
14 10 2013
15 10 2013
16 11 2013
17 12 2013
18 13 2013
19 13 2013
20 14 2013
1 1 2014
2 2 2014
3 2 2014
4 3 2014
5 4 2014
6 4 2014
7 5 2014
8 6 2014
9 7 2014
10 7 2014
11 8 2014
12 9 2014
13 10 2014
14 10 2014
15 10 2014
16 10 2014
17 11 2014
18 11 2014
19 12 2014
20 13 2014
1 1 2015
2 2 2015
3 3 2015
4 3 2015
5 4 2015
6 5 2015
7 5 2015
8 6 2015
9 6 2015
10 7 2015
11 8 2015
12 9 2015
13 10 2015
14 11 2015
15 12 2015
16 12 2015
17 13 2015
18 14 2015
19 15 2015
20 16 2015
1 1 2016
2 2 2016
3 3 2016
4 3 2016
5 4 2016
6 5 2016
7 6 2016
8 7 2016
9 7 2016
10 8 2016
11 9 2016
12 10 2016
13 11 2016
14 12 2016
15 13 2016
16 14 2016
17 15 2016
18 16 2016
19 17 2016
20 18 2016
1 1 2017
2 2 2017
3 3 2017
4 4 2017
5 5 2017
6 6 2017
7 7 2017
8 7 2017
9 8 2017
10 9 2017
11 10 2017
12 10 2017
13 11 2017
14 12 2017
15 12 2017
16 13 2017
17 14 2017
18 15 2017
19 16 2017
20 17 2017
1 1 2018
2 2 2018
3 3 2018
4 4 2018
5 5 2018
6 5 2018
7 6 2018
8 7 2018
9 8 2018
10 9 2018
11 10 2018
12 10 2018
13 11 2018
14 12 2018
15 12 2018
16 12 2018
17 13 2018
18 14 2018
19 15 2018
20 16 2018
1 1 2019
2 2 2019
3 3 2019
4 4 2019
5 5 2019
6 5 2019
7 6 2019
8 6 2019
9 7 2019
10 8 2019
11 8 2019
12 9 2019
13 10 2019
14 11 2019
15 12 2019
16 12 2019
17 13 2019
18 14 2019
19 15 2019
20 16 2019
1 1 2020
2 2 2020
3 3 2020
4 4 2020
5 5 2020
6 5 2020
7 6 2020
8 6 2020
9 6 2020
10 6 2020
11 6 2020
12 7 2020
13 8 2020
14 8 2020
15 8 2020
16 8 2020
17 8 2020
18 8 2020
19 9 2020
20 10 2020
@gallochris
Copy link
Author

code . . .

## libraries 
library(ggplot2)
library(hrbrthemes)
library(directlabels)

#code
ggplot(charts.data, aes(x=G, y=W)) +
  geom_line(aes(color=Product)) +
  scale_x_continuous(breaks=seq(1,20,1)) + 
  scale_y_continuous(breaks=seq(0,20,5)) + 
  labs(x="Game number (first 20 games)", y="Win Total") +
  ggtitle("Carolina: Total Wins in First 20 Games by Season in Roy Williams Era (Since 2003-04)",
  subtitle="Tar Heels are 10-10 in the first 20 games in 2019-20. Best record in first 20 games is 19-1 in 2007-2008 season.") +
  geom_dl(aes(label=Product, color=Product)
                    , method = list("last.polygons")) + 
                    theme_ipsum() 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment