Skip to content

Instantly share code, notes, and snippets.

View brooke-watson's full-sized avatar

Brooke Watson Madubuonwu brooke-watson

View GitHub Profile
@brooke-watson
brooke-watson / cursed_starwars_data.R
Last active December 10, 2019 19:51
cursed_data_challenge
# ---------------------------------------
# untidy data
# ---------------------------------------
# this dataset is a sample of the kind of data that might appear in the wild,
# particularly when dealing with government data,
# particularly when trying to convert an output table or individual report
# back into a raw data format that can be analyzed.
# in these test datasets, discrete observations are spread out across multiple rows.
@brooke-watson
brooke-watson / weekly-release-clean.R
Created June 15, 2019 19:16
Weekly release script
# Weekly release script (modeled off of https://gist.github.com/alicegoldfuss/d9a4a8cce0b45e3d37060a07aec616dc)
library(httr)
library(tidyverse)
library(twilio)
library(emo)
HEADERS <- c(Accept = 'application/vnd.github.inertia-preview+json') # named vector for add_headers
GH_TOKEN <- "XXX" # Your auth token from https://github.com/settings/tokens
Sys.setenv(TWILIO_SID = "XXX") # Your Account SID from twilio.com/console
'%=%' = function(l, r, ...)
UseMethod('%=%')
# Binary Operator
'%=%.lbunch' = function(l, r, ...) {
Envir = as.environment(-1)
if (length(r) > length(l))
warning("Right side has more args than left side. Only first ", length(l), " arguments used.")