Skip to content

Instantly share code, notes, and snippets.

View levithatcher's full-sized avatar

Levi Thatcher levithatcher

View GitHub Profile
@levithatcher
levithatcher / IntroHealthDataAnalysisInR_OUT.nb.html
Created January 17, 2017 19:18
Getting started with health data analysis in R
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@levithatcher
levithatcher / IntroHealthDataAnalysisInR.Rmd
Created January 17, 2017 18:41
Getting started with health data analysis in R
---
title: "Intro to health data analysis in R"
output: html_notebook
---
## Background
Today we want to demonstrate how R can provide a one-stop-shop for health data analysis.
We'll start with base R today, and show how [dplyr](https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html) makes life easier.
@levithatcher
levithatcher / CountyPublicHealthChoropleth.R
Last active January 25, 2019 21:15
Create county-level choropleths of low-birth weight, premature death, and their relationship to county income
removeCommasInNumber <- function(column) {
column <- as.numeric(gsub(",", "", column))
column
}
createChoropleth <- function(df,
colToPlot,
title,
legend,
numColors=1,
library(ggplot2)
library(ggthemes)
library(scales)
# Grab data from here: https://data.stackexchange.com/stackoverflow/query/596780/language-trends-questions-per-tag-per-month
# setwd() <-- You may need this
df <- read.csv('LanguageComparisonOverTime.csv')
str(df)
@levithatcher
levithatcher / index.html
Created August 24, 2015 12:22
LoadText
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='//dimplejs.org/dist/dimple.v2.1.0.min.js' type='text/javascript'></script>
<style>
.rChart {
@levithatcher
levithatcher / index.html
Created August 24, 2015 03:00
LoadText
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='//dimplejs.org/dist/dimple.v2.1.0.min.js' type='text/javascript'></script>
<style>
.rChart {