Articles by Mark T Patterson

Morse Code Converter

February 8, 2015 | Mark T Patterson

A few months ago, I finally got a chance to see The Imitation Game (the new Alan Turing movie), which gave me an idea for a Sunday morning R hacking session. The movie features a bunch of scenes with bustling rooms full or workers intercepting (and documenting) encrypted radio transmissions, ... [Read more...]

Quarterback Completion Heatmap Using dplyr

October 26, 2014 | Mark T Patterson

Several months ago, I found Bryan Povlinkski's (really nicely cleaned) dataset with 2013 NFL play-by-play information, based on data released by Brian Burke at Advanced Football Analytics. I decided to browse QB completion rates based on Pass Location (Left, Middle, Right), Pass Distance (Short or Deep), and Down. I ended up ... [Read more...]

T-Shirts … designed with R!

May 18, 2014 | Mark T Patterson

On Friday, I saw David Smith's post on a competition to design this year's useR! conference t-shirt. The goal is to create a design generated using an R script, which will be featured on the back of the shirt. Having a bit of time this weekend, I decided to try ... [Read more...]

Play 2048… using R!

April 19, 2014 | Mark T Patterson

I've lost about 100 hours over the past week to the black hole of 2048. In an attempt to extricate myself, I thought I'd try writing an R script to play for me. While there are already a ton of great algorithms for the game, I haven't seen any implemented in R. ... [Read more...]

Rblogger Posting Patterns Analyzed with R

April 11, 2014 | Mark T Patterson

I've been a big fan of rbloggers for quite some time, but have only recently started contributing myself. After my first post yesterday, I immidiately started wondering how long most other bloggers go between posts. I decided to gather the list of past posts to rbloggers to investigate a bit. ... [Read more...]

College Basketball: Presence in the NBA over Time

November 7, 2013 | Mark T Patterson

Interested in practicing a bit of web-scraping, I decided to make use of a nice dataset provided by Databasebasketball.com in order to examine the representation of various college programs in the NBA/ABA over time. This dataset only includes retired players, and ends in 2010, so I decided to only ... [Read more...]

Simulating Abstract Art with R

November 3, 2013 | Mark T Patterson

Piet Mondrian Composition with Red, Blue, Black, Yellow, and Gray (1921): An example draw from my simulation function: We're in the midst of planning our spring course on Empirical Research Methods, and as a result, I've found myself spending a lot of time thinking about some of the fist ideas in ... [Read more...]

Quarterback Wonderlic Scores by Institution (Academic) Strength

November 1, 2013 | Mark T Patterson

## geom_smooth: method="auto" and size of largest group is <1000, so using<br>## loess. Use 'method = x' to change the smoothing method.<br>
I remember my dad telling me that when he was at Northwestern in the mid-70s, the team was essentially winless. As a small consolation, he remembered that the football team had actually been full of good students. Some time ago, I stumbled across nflcombineresults.com. Among other measures, ... [Read more...]

CrossFit weights: gender matters less than you’d think

April 17, 2013 | Mark T Patterson

Exploring Gaussian Mixture Models Exploring Gaussian Mixture Models This week in the Empirical Research Methods course, we've been talking a lot about measurement error. The idea of having some latent variable of interest, coupled with 'flawed' measures reminded me of a section of Cosma's course I really enjoyed, but haven't ... [Read more...]

Behavioral Economics and Beer… highly correlated

March 19, 2013 | Mark T Patterson

Short: I plot the frequency of wikipedia searches of “Behavioral Economics”, and “Beer” – who knew the correlation would be 0.7! Data reference:Data on any wikipedia searches (back to 2007) are available at http://glimmer.rstudio.com/pssguy/wikiSearchRates/. The website allows you to download frequency hits per day as a csv, ... [Read more...]

ddply in action

March 7, 2013 | Mark T Patterson

Top Batting Averages Over Time Top Batting Averages Over Time reference:http://www.baseball-databank.org/ ShortI'm going to use plyr and ggplot2 to look at how top batting averages have changed over time First load the data:
options(width = 100)<br>library(ggplot2)<br>
## Warning message: package 'ggplot2' was built under R version 2.14.2<br>
library(plyr)<br><br>data(baseball)<br>head(baseball)<br>
##            id year stint team lg  g  ab  r  h X2b X3b hr rbi sb cs bb so ibb hbp sh sf gidp<br>## 4   ansonca01 1871     1  RC1    25 120 29 39  11   3  0  16  6  2  2  1  NA  NA NA NA   NA<br>## 44  forceda01 1871     1  WS3    32 162 45 45   9   4  0  29  8  0  4  0  NA  NA NA NA   NA<br>## 68  mathebo01 1871     1  FW1    19  89 15 24   3   1  0  10  2  1  2  0  NA  NA NA NA   NA<br>## 99  startjo01 1871     1  NY2    33 161 35 58   5   1  1  34  4  2  3  0  NA  NA NA NA   NA<br>## 102 suttoez01 1871     1  CL1    29 128 35 45   3   7  3  23  3  1  1  0  NA  NA NA NA   NA<br>## 106 whitede01 1871     1  CL1    29 146 40 47   6   5  1  21  2  2  4  1  NA  NA NA NA   NA<br>
It looks like we've loaded the data successfully. Next, ... [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)