Skip to content

Instantly share code, notes, and snippets.

View wmay's full-sized avatar

Will May wmay

View GitHub Profile
@wmay
wmay / Texas COVID-19 Deaths Comparison.ipynb
Last active July 8, 2020 18:00
Texas COVID-19 death counts, NYTimes vs. TX DSHS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wmay
wmay / latex_engine.Rmd
Last active December 2, 2019 02:30
Simple Latex knitr engine
---
title: "Latex engine test"
author: "William May"
date: "December 1, 2019"
output: pdf_document
---
```{r setup, include=FALSE}
library(knitr)
opts_chunk$set(echo = TRUE)
@wmay
wmay / ssp_scraper.R
Last active November 18, 2019 03:23
Scrape crime data from São Paulo State's Institute
library(rvest)
ssp_url = 'http://www.ssp.sp.gov.br/estatistica/pesquisa.aspx'
## get the region/municipality form
sess = html_session(ssp_url)
form = html_form(sess)[[2]]
## see form options
head(form$fields$`ctl00$conteudo$ddlRegioes`$options)
head(form$fields$`ctl00$conteudo$ddlMunicipios`$options)
## submit the form to get a new page
@wmay
wmay / TravisCI-Mascot-1.png
Last active November 18, 2019 07:19
Modern Data Workflow presentation
TravisCI-Mascot-1.png
@wmay
wmay / trump_hate_crimes.R
Last active September 10, 2019 20:49
Trump rallies and hate crimes
## are Trump (or Clinton) rallies associated with hate crimes?
library(MASS)
## organize data (downloaded from the analysis page, under the "Hate
## Incidents" tab)
## https://public.tableau.com/profile/matthew.lilley#!/vizhome/TrumpRallies_15676277431850/Population-TrumpRally
hate = read.csv('Hate_Incidents_data.csv', check.names = F,
stringsAsFactors = F)
hate$Geoid = as.factor(hate$Geoid)
@wmay
wmay / sex.R
Created March 30, 2019 16:51
Quick analysis of recent sex trends (2008-2018) with GSS data
## looking at sex trends
library(foreign)
## oh wow this is a large file
gss = read.spss('/home/will/research/gss/GSS7218_R1.sav', to.data.frame = T)
## do a bit of organizing
names(gss) = tolower(names(gss))
gss$wtssall = as.numeric(as.character(gss$wtssall))
@wmay
wmay / shapely vectorized GEOS.ipynb
Created July 9, 2017 20:33
Testing vectorized GEOS functions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.