Last active
September 2, 2015 17:32
-
-
Save matt-bernhardt/d320eff81a8dbee19e0e to your computer and use it in GitHub Desktop.
This is a quick bit of R code to generate a playing time evolution plot. The model (although generated in Excel) can be seen at http://www.massivereportdata.com/blog/wp-content/uploads/2015/09/playing-time-dallas-missing-players.png , and is discussed at some length at http://www.massivereportdata.com/blog/2015/09/02/columbus-dallas-lineup-stabi…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colors=c("#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#a65628","#f781bf") | |
par(new=F) | |
j = 1 | |
for (i in names(team1)) { | |
if (j==1) { | |
plot(team1[[i]],ylim=c(0,1),type="l",xlab="Game number",ylab="Percentage of playing time",main="Evolution of playing time - FC Dallas",col=colors[j%%6],pch=19,las=1,mai=c(1,2,1,8),xlim=c(1,34),cex.axis=0.7,cex.lab=0.85,yaxt="n") | |
axis(2,at=pretty(team1[[i]]), lab=paste0(pretty(team1[[i]]) * 100,"%"), las=TRUE, cex.axis=0.7) | |
} else { | |
plot(team1[[i]],ylim=c(0,1),type="l",xlab="",ylab="",main="",col=colors[j%%6],pch=19,mai=c(1,2,1,8),axes=FALSE,mar=c(1,2,1,8),xlim=c(1,34)) | |
} | |
text(28,team1[[27,i]],names(team1[i]),adj=c(0,0.5),cex=0.5) | |
par(new=T) | |
j = j + 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kellyn Acosta | Tesho Akindele | Michael Barrios | Kyle Bekker | Fabian Castillo | Coy Craft | Mauro Diaz | Otis Earle | Rolando Escobar | Jesse Gonzalez | Atiba Harris | Matt Hedges | Moises Hernandez | Ryan Hollingshead | Dan Kennedy | Zach Loyd | Michel | Blas Perez | Chris Seitz | David Texeira | Victor Ulloa | Je-Vaughn Watson | Alejandro Zendejas | Walker Zimmerman | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 0.166666667 | 0 | 1 | 0 | 0.955555556 | 0 | 0 | 0 | 0.988888889 | 1 | 1 | 0.833333333 | 0 | 1 | 0.044444444 | 1 | 1 | 0 | 1 | 0 | 0 | 0.011111111 | |
0 | 0.922222222 | 0.161111111 | 0.005555556 | 0.994444444 | 0 | 0.861111111 | 0 | 0 | 0 | 0.994444444 | 1 | 1 | 0.533333333 | 0 | 1 | 0.522222222 | 1 | 1 | 0 | 1 | 0 | 0 | 0.005555556 | |
0 | 0.948148148 | 0.107407407 | 0.044444444 | 0.996296296 | 0 | 0.896296296 | 0 | 0 | 0 | 0.996296296 | 1 | 1 | 0.522222222 | 0 | 1 | 0.514814815 | 0.959259259 | 1 | 0.011111111 | 1 | 0 | 0 | 0.003703704 | |
0.047222222 | 0.961111111 | 0.091666667 | 0.033333333 | 0.997222222 | 0 | 0.672222222 | 0 | 0 | 0 | 0.997222222 | 1 | 0.75 | 0.630555556 | 0 | 1 | 0.636111111 | 0.719444444 | 1 | 0.172222222 | 1 | 0 | 0 | 0.088888889 | |
0.037777778 | 0.968888889 | 0.08 | 0.026666667 | 0.997777778 | 0 | 0.537777778 | 0 | 0 | 0 | 0.991111111 | 1 | 0.6 | 0.657777778 | 0 | 1 | 0.708888889 | 0.637777778 | 1 | 0.275555556 | 1 | 0.046666667 | 0 | 0.271111111 | |
0.031481481 | 0.974074074 | 0.094444444 | 0.105555556 | 0.998148148 | 0 | 0.448148148 | 0 | 0 | 0 | 0.909259259 | 0.833333333 | 0.583333333 | 0.687037037 | 0 | 1 | 0.674074074 | 0.698148148 | 1 | 0.22962963 | 1 | 0.205555556 | 0 | 0.392592593 | |
0.028571429 | 0.873015873 | 0.185714286 | 0.09047619 | 0.996825397 | 0 | 0.384126984 | 0 | 0 | 0 | 0.792063492 | 0.857142857 | 0.642857143 | 0.719047619 | 0 | 1 | 0.720634921 | 0.741269841 | 1 | 0.196825397 | 1 | 0.319047619 | 0 | 0.336507937 | |
0.15 | 0.8 | 0.1625 | 0.079166667 | 0.997222222 | 0 | 0.425 | 0 | 0 | 0 | 0.704166667 | 0.838888889 | 0.6875 | 0.743055556 | 0.125 | 1 | 0.630555556 | 0.730555556 | 0.875 | 0.172222222 | 1 | 0.404166667 | 0 | 0.330555556 | |
0.244444444 | 0.730864198 | 0.144444444 | 0.07037037 | 0.992592593 | 0 | 0.469135802 | 0 | 0 | 0 | 0.625925926 | 0.856790123 | 0.722222222 | 0.771604938 | 0.222222222 | 0.928395062 | 0.560493827 | 0.649382716 | 0.777777778 | 0.264197531 | 1 | 0.47037037 | 0.004938272 | 0.365432099 | |
0.286666667 | 0.707777778 | 0.13 | 0.096666667 | 0.993333333 | 0 | 0.522222222 | 0 | 0 | 0 | 0.663333333 | 0.771111111 | 0.75 | 0.744444444 | 0.3 | 0.835555556 | 0.51 | 0.678888889 | 0.7 | 0.237777778 | 1 | 0.523333333 | 0.004444444 | 0.428888889 | |
0.345454545 | 0.703030303 | 0.149494949 | 0.087878788 | 0.992929293 | 0 | 0.565656566 | 0 | 0 | 0 | 0.603030303 | 0.791919192 | 0.772727273 | 0.677777778 | 0.363636364 | 0.75959596 | 0.46969697 | 0.708080808 | 0.636363636 | 0.216161616 | 1 | 0.566666667 | 0.004040404 | 0.480808081 | |
0.316666667 | 0.678703704 | 0.137037037 | 0.096296296 | 0.993518519 | 0 | 0.601851852 | 0 | 0 | 0 | 0.562037037 | 0.809259259 | 0.782407407 | 0.688888889 | 0.416666667 | 0.696296296 | 0.47962963 | 0.732407407 | 0.583333333 | 0.198148148 | 1 | 0.602777778 | 0.003703704 | 0.524074074 | |
0.292307692 | 0.68974359 | 0.126495726 | 0.165811966 | 0.917094017 | 0 | 0.617094017 | 0 | 0.038461538 | 0 | 0.518803419 | 0.823931624 | 0.799145299 | 0.712820513 | 0.461538462 | 0.679487179 | 0.458119658 | 0.714529915 | 0.538461538 | 0.196581197 | 1 | 0.633333333 | 0.003418803 | 0.483760684 | |
0.271428571 | 0.711904762 | 0.176984127 | 0.153968254 | 0.875396825 | 0 | 0.644444444 | 0 | 0.035714286 | 0 | 0.553174603 | 0.828571429 | 0.75 | 0.673809524 | 0.5 | 0.630952381 | 0.473015873 | 0.663492063 | 0.5 | 0.253968254 | 1 | 0.647619048 | 0.003174603 | 0.520634921 | |
0.253333333 | 0.664444444 | 0.165185185 | 0.198518519 | 0.883703704 | 0.004444444 | 0.668148148 | 0 | 0.045185185 | 0 | 0.516296296 | 0.773333333 | 0.7 | 0.695555556 | 0.533333333 | 0.655555556 | 0.508148148 | 0.685925926 | 0.466666667 | 0.237037037 | 1 | 0.604444444 | 0.065185185 | 0.552592593 | |
0.250694444 | 0.622916667 | 0.217361111 | 0.248611111 | 0.863194444 | 0.031944444 | 0.626388889 | 0.023611111 | 0.042361111 | 0 | 0.484027778 | 0.725 | 0.65625 | 0.714583333 | 0.5 | 0.677083333 | 0.515277778 | 0.643055556 | 0.5 | 0.284722222 | 0.986805556 | 0.566666667 | 0.123611111 | 0.580555556 | |
0.294771242 | 0.58627451 | 0.25620915 | 0.263398693 | 0.87124183 | 0.030065359 | 0.631372549 | 0.022222222 | 0.039869281 | 0 | 0.455555556 | 0.689542484 | 0.617647059 | 0.731372549 | 0.529411765 | 0.696078431 | 0.514379085 | 0.664052288 | 0.470588235 | 0.267973856 | 0.987581699 | 0.533333333 | 0.133333333 | 0.605228758 | |
0.333950617 | 0.572222222 | 0.241975309 | 0.248765432 | 0.869135802 | 0.028395062 | 0.651851852 | 0.020987654 | 0.037654321 | 0 | 0.485802469 | 0.706790123 | 0.592592593 | 0.734567901 | 0.555555556 | 0.712962963 | 0.485802469 | 0.638888889 | 0.444444444 | 0.290123457 | 0.988271605 | 0.559259259 | 0.125925926 | 0.571604938 | |
0.333918129 | 0.542105263 | 0.281871345 | 0.235672515 | 0.823391813 | 0.026900585 | 0.61754386 | 0.019883041 | 0.088304094 | 0 | 0.512865497 | 0.704678363 | 0.587719298 | 0.73625731 | 0.526315789 | 0.675438596 | 0.512865497 | 0.605263158 | 0.473684211 | 0.32748538 | 0.962573099 | 0.58245614 | 0.131578947 | 0.594152047 | |
0.367222222 | 0.515 | 0.284444444 | 0.223888889 | 0.832222222 | 0.025555556 | 0.630555556 | 0.018888889 | 0.097222222 | 0 | 0.537222222 | 0.719444444 | 0.558333333 | 0.732777778 | 0.55 | 0.691666667 | 0.487222222 | 0.575 | 0.45 | 0.347777778 | 0.964444444 | 0.603333333 | 0.131111111 | 0.564444444 | |
0.397354497 | 0.49047619 | 0.310582011 | 0.213227513 | 0.84021164 | 0.024338624 | 0.648148148 | 0.017989418 | 0.100529101 | 0 | 0.559259259 | 0.732804233 | 0.531746032 | 0.745502646 | 0.571428571 | 0.706349206 | 0.464550265 | 0.547619048 | 0.428571429 | 0.374603175 | 0.965608466 | 0.574603175 | 0.129100529 | 0.537566138 | |
0.424747475 | 0.473737374 | 0.336363636 | 0.203535354 | 0.847474747 | 0.023232323 | 0.663636364 | 0.017171717 | 0.098484848 | 0 | 0.579292929 | 0.744949495 | 0.507575758 | 0.757070707 | 0.590909091 | 0.71969697 | 0.443434343 | 0.522727273 | 0.409090909 | 0.400505051 | 0.967171717 | 0.548484848 | 0.123232323 | 0.513636364 | |
0.449758454 | 0.456038647 | 0.365217391 | 0.19468599 | 0.851207729 | 0.022222222 | 0.677294686 | 0.016425121 | 0.1 | 0 | 0.597584541 | 0.756038647 | 0.485507246 | 0.76763285 | 0.608695652 | 0.731884058 | 0.424154589 | 0.5 | 0.391304348 | 0.420772947 | 0.968599034 | 0.524637681 | 0.11884058 | 0.491304348 | |
0.472685185 | 0.45787037 | 0.391666667 | 0.186574074 | 0.857407407 | 0.021296296 | 0.690740741 | 0.015740741 | 0.110648148 | 0 | 0.614351852 | 0.766203704 | 0.468981481 | 0.773611111 | 0.625 | 0.743055556 | 0.406481481 | 0.479166667 | 0.375 | 0.424074074 | 0.955092593 | 0.502777778 | 0.113888889 | 0.470833333 | |
0.493777778 | 0.446666667 | 0.416 | 0.179111111 | 0.863111111 | 0.020444444 | 0.663111111 | 0.015111111 | 0.146222222 | 0 | 0.629333333 | 0.775555556 | 0.450222222 | 0.779555556 | 0.64 | 0.713333333 | 0.390222222 | 0.5 | 0.36 | 0.407111111 | 0.949777778 | 0.522666667 | 0.112444444 | 0.452444444 | |
0.513247863 | 0.443162393 | 0.438461538 | 0.172222222 | 0.868376068 | 0.01965812 | 0.637606838 | 0.014529915 | 0.171794872 | 0.038461538 | 0.643589744 | 0.784188034 | 0.432905983 | 0.752136752 | 0.615384615 | 0.724358974 | 0.375213675 | 0.505555556 | 0.346153846 | 0.398717949 | 0.949145299 | 0.541025641 | 0.108119658 | 0.435042735 | |
0.53127572 | 0.463786008 | 0.459259259 | 0.165843621 | 0.872016461 | 0.018930041 | 0.61399177 | 0.01399177 | 0.166666667 | 0.074074074 | 0.619753086 | 0.79218107 | 0.416872428 | 0.755967078 | 0.592592593 | 0.734567901 | 0.361316872 | 0.494650206 | 0.333333333 | 0.413168724 | 0.951028807 | 0.558024691 | 0.104115226 | 0.424279835 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment