Skip to content

Instantly share code, notes, and snippets.

View matt-bernhardt's full-sized avatar
💭
Learning Rails...

Matthew Bernhardt matt-bernhardt

💭
Learning Rails...
View GitHub Profile
# Read in teams
team11 <- read.csv("minutes_evolution_11_2015.csv")
team12 <- read.csv("minutes_evolution_12_2015.csv")
team13 <- read.csv("minutes_evolution_13_2015.csv")
team14 <- read.csv("minutes_evolution_14_2015.csv")
team15 <- read.csv("minutes_evolution_15_2015.csv")
team16 <- read.csv("minutes_evolution_16_2015.csv")
team17 <- read.csv("minutes_evolution_17_2015.csv")
team18 <- read.csv("minutes_evolution_18_2015.csv")
team19 <- read.csv("minutes_evolution_19_2015.csv")
@matt-bernhardt
matt-bernhardt / Fig1.png
Last active September 30, 2015 05:11
An analysis of lineups from MLS teams between 2013-2015 to identify whether the Open Cup is "taken seriously" by participating teams
Fig1.png
@matt-bernhardt
matt-bernhardt / playing_time_evolution.R
Last active September 2, 2015 17:32
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…
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))
}
.Rproj
@matt-bernhardt
matt-bernhardt / search.html
Last active September 1, 2015 16:04
Search Bar Markup
<div id="search-main" class="search--lib-resources flex-container">
<h2>Search</h2>
<div class="search-options--static flex-container js-hidden">
<div class="col-1">
<div>Articles, e-books, &amp; more:</div>
<div>E-Journals &amp; databases:</div>
<div>Books &amp; more at MIT:</div>
<div>Books &amp; more worldwide:</div>
</div>
<div class="col-2"> <a href="/bartonplus">BartonPlus (mega search)</a> <a href="/vera">Vera</a> <a href="/barton">Barton (classic search)</a> <a href="/worldcat">WorldCat</a> <a href="/reserves">Course reserves</a> <a href="/about/site-search">Site search</a> </div>
@matt-bernhardt
matt-bernhardt / 070831_mls_salaries.csv
Last active January 27, 2016 04:41
Files describing salary expenditures in Major League Soccer from 2007 through 2015. See more at
Club Last Name First Name Pos Base Salary Compensation
CHI Armas Chris M $225,000.00 $225,000.00
CHI Banner Michael M $12,900.00 $12,900.00
CHI Barrett Chad F $41,212.50 $48,712.50
CHI Blanco Cuauhtemoc F $2,492,316.00 $2,666,778.00
CHI Brown C.J. D $106,391.00 $106,391.00
CHI Busch Jon GK $58,008.00 $58,008.00
CHI Carr Calen F $38,000.00 $50,500.00
CHI Conde Wilman D $144,000.00 $151,500.00
CHI Correa Thiago M $44,100.00 $44,100.00
@matt-bernhardt
matt-bernhardt / soccer_combos_4.pde
Created August 2, 2015 03:22
This Processing sketch is used to generate plots that illustrate shared playing time between teammates on a soccer team. An example can be seen at https://twitter.com/bernhardtsoccer/status/627678873422045184
/* Player Combinations 4 - complete rebuild
* ---
* This is a ground-up rebuild of the player combinations sketch
* that attempts to roll all calculations into a single workflow.
*
* If I can work in >2 combination information, that would be
* awesome.
*/
// Import libraries
@matt-bernhardt
matt-bernhardt / potential_free_agents.csv
Created March 4, 2015 03:20
A list of possible free agents in MLS, should the new collective bargaining agreement set the threshold at 28 years of age with eight years of competition within MLS.
Adam Moffat 1986-05-15 8 Years
Marvell Wynne 1986-04-25 9 Years
Corey Ashe 1986-03-14 8 Years
Jacob Peterson 1986-01-27 9 Years
Michael Harrington 1986-01-24 8 Years
Dominic Oduro 1985-08-13 9 Years
Patrick Ianni 1985-06-15 9 Years
Fabian Espindola 1985-05-04 8 Years
Chad Barrett 1985-04-30 10 Years
Brad Evans 1985-04-20 8 Years
@matt-bernhardt
matt-bernhardt / README.md
Last active August 29, 2015 14:15
Combination of list items, v2

This is an attempt to build a visualization pattern showing combinations among items in a single list. It is inspired by a device I remember from printed maps, showing distances between cities - usually printed in an unused corner.

This pattern currently works best for combinations that are direction-agnostic. In this example, the datasete illustrates how often a group of soccer players appeared together over the course of a single season. For bi-directional combinations a different strategy may be needed, or perhaps a more nuanced design at each intersection.

@matt-bernhardt
matt-bernhardt / combinations.css
Last active August 29, 2015 14:15
Combination of list items
svg {
font: 10px sans-serif;
}
.cell,
.label {
opacity: 0.5;
}
.cell:hover,