Skip to content

Instantly share code, notes, and snippets.

@jonocarroll
jonocarroll / stack.R
Created May 27, 2016 06:43
How did I not know about stack(), unstack(), and applying formula to a data.frame?
tmp <- data.frame(a = c(1, 2, 3), b = c(4, 3, 5), c = c(4, 4, 5))
tmp
# a b c
# 1 1 4 4
# 2 2 3 4
# 3 3 5 5
formula(tmp)
# a ~ b + c
@expersso
expersso / rentswatch.R
Created May 20, 2016 14:20
Explorations in functional programming
library(httr)
library(purrr)
library(dplyr)
library(ggplot2)
library(scales)
library(ggthemes)
with_msg <- function(msg, f) {
function(...) {
@hrbrmstr
hrbrmstr / orig.png
Last active July 16, 2023 06:43
Supreme Annotations - moar splainin here: http://rud.is/b/2016/03/16/supreme-annotations/ - NOTE: this requires the github version of ggplot2
orig.png