Skip to content

Instantly share code, notes, and snippets.

View lmullen's full-sized avatar

Lincoln Mullen lmullen

View GitHub Profile
@lmullen
lmullen / README.md
Last active November 11, 2015 10:37
Word count history

A quick and dirty script to check out each commit of a writing project and find the word count of each Markdown file at that point in time. You might want to use this on a clone of your writing repository. NO WARRANTY EXPRESS OR IMPLIED.

@lmullen
lmullen / README.md
Created March 31, 2014 03:00
CSV files into a list of data frames

Read a collection of CSV files into a single list object in R, and give each item in the list the name of the file from which it was read.

@lmullen
lmullen / index.html
Last active August 29, 2015 13:57
Dissertation motivation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.1.1/css/normalize.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.1.1/css/foundation.min.css">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
p {
font-size: 18px;
@lmullen
lmullen / README.md
Created March 26, 2014 00:01
Attribution function for R
@lmullen
lmullen / README.md
Last active August 25, 2019 14:22
Distance matrix in R

An example of using a matrix to find which cities are closest to one another. The file distances-from-google.r downloads some sample data from Google's Distance Matrix API and converts it from a JSON object to an R matrix. The file distance-matrix.r creates a function to find the closest city in each row of a distance matrix.

Results:

  • New York is closest to Philadelphia
  • Los Angeles is closest to Houston
@lmullen
lmullen / README.md
Last active August 29, 2015 13:57
Quicksort algorithm in R to demonstrate recursion
@lmullen
lmullen / analysis.r
Last active December 7, 2018 14:41
Charting Faculty Salaries
library(dplyr)
library(reshape2)
library(stringr)
library(ggplot2)
library(RColorBrewer)
# options(stringsAsFactors = FALSE)
options("scipen"=100, "digits"=4)
salaries <- read.csv("faculty-salaries-2013-14.csv")
@lmullen
lmullen / README.md
Last active August 29, 2015 13:57
Reusable Scatter Plot Function

Learning to create a reusable chart function for a scatter plot, following Mike Bostock's "Towards Reusable Charts." Also includes a random data generator.

@lmullen
lmullen / pandoc-copy.vim
Created March 13, 2014 17:41
Convert pandoc buffer to HTML and copy to system clipboard
" Convert pandoc buffer to HTML and copy to system clipboard
autocmd FileType pandoc nnoremap <buffer> <C-S-x> :write \| let @+ = system("pandoc -t html " . shellescape(expand("%:p")))<CR>
@lmullen
lmullen / convert-file-encoding-line-breaks.zsh
Created March 12, 2014 20:46
Convert text files in cp1252 with dos line endings to files in UTF-8 with Unix line endings
# Convert text files in cp1252 with dos line endings to files in UTF-8 with
# Unix line endings
for file (*.txt) {iconv -f cp1252 -t utf-8 $file -o $file}
dos2unix *.txt