Skip to content

Instantly share code, notes, and snippets.

View dgopstein's full-sized avatar

Dan Gopstein dgopstein

View GitHub Profile
@dgopstein
dgopstein / spot_matrix.R
Last active January 11, 2019 01:58
Spot Matrix in R with ggplot2
##################################
# Data
##################################
ops.mat <-
matrix(c(392, 114, 250, 115, 115, 78,
2349, 560, 428, 286, 226, 173,
4037, 1215, 817, 879, 479, 337,
966, 592, 142, 256, 90, 407),
nrow=4, byrow=TRUE)
@dgopstein
dgopstein / read_data_file_with_liquid.rb
Created March 10, 2017 07:33
Jekyll Plugin for Textual Inclusion in Data Files
# Treat every _data file as liquid.
# This allows us to include YAML files in other YAML files.
module Jekyll
# Monkey patch Jekyll::DataReader::read_data_file with our own implementation
class DataReader
def read_data_file_with_liquid(path)
begin
dir = File.dirname(path)
filename = File.basename(path)