Skip to content

Instantly share code, notes, and snippets.

View ulfelder's full-sized avatar

Jay Ulfelder ulfelder

View GitHub Profile
@guga31bb
guga31bb / nflscrapr.md
Last active August 18, 2023 07:45
Simple guide for using nflscrapR

THIS IS OUTDATED. PLEASE FOLLOW THE FOLLOWING LINK

--> A beginner's guide to nflfastR <--

Basic nflscrapR tutorial

I get a lot of questions about how to get nflscrapR up and running. This guide is intended to help new users build interesting tables or charts from the ground up, taking the raw nflscrapR data.

Quick word if you're new to programming: all of this is happening in R. Obviously, you need to install R on your computer to do any of this. Make sure you save what you're doing in a script (in R, File --> New script) so you can save your work and run multiple lines of code at once. To run code from a script, highlight what you want, right click, and select Run line. As you go through your R journey, you might get stuck and have to google a bunch of things, but that's totally okay and normal. That's how I wrote this thing!

@mschnetzer
mschnetzer / selfassessment.r
Last active December 31, 2019 10:33
Current and estimated position in the net wealth distribution (https://twitter.com/matschnetzer/status/1090954828631732224)
library(tidyverse)
library(survey)
library(msthemes)
library(gganimate)
# Load HFCS and Non-core data
load("hfcs2014AT.rda")
load("Noncore AT/non-core-at.rda")
# Calculate estimated decile with mean from multiple imputation data
# metadata
data_source <- "https://docs.google.com/spreadsheets/d/1xa0iLqYKz8x9Yc_rfhtmSOJQ2EGgeUVjvV4A8LsIaxY/htmlview?sle=true#gid=0"
data_collectors <- "Jeremy Pressman (@djpressman, U of Connecticut) and\nErica Chenoweth (@EricaChenoweth, U of Denver)"
code_gist <- "https://gist.github.com/benmarwick/a1ac9c7235ebef542824512162ff2f44"
# ------------------------------------------------------------------------
# read in data from google sheets to get a data frame