Skip to content

Instantly share code, notes, and snippets.

library('tidyverse')
population <- read_csv('baltimorepop.csv')
ggplot(population,
aes(x = factor(year),
y = pop/1000,
color = city,
group = city)) +
geom_line(size = 2) +
@underthecurve
underthecurve / code.R
Created March 28, 2020 23:19
baltimore vs dc population
library('tidyverse')
population <- read_csv('baltimorepop.csv')
ggplot(population,
aes(x = factor(year),
y = pop/1000,
color = city,
group = city)) +
geom_line(size = 2) +
@underthecurve
underthecurve / nicar_lightningtalks_numbers.R
Created February 14, 2020 22:43
lightning talks graphic
library('tidyverse')
talks.10.18 <- read_csv(url("https://raw.githubusercontent.com/underthecurve/lightning-talks-analysis/master/lightningtalks_clean.csv"))
talks.10.18.grouped <- talks.10.18 %>%
group_by(year) %>%
summarise(n = n())
talks.10.19.grouped <- talks.10.18.grouped %>%
library('dplyr')
library('ggplot2')
attendance <- read.csv('attendance2019.csv', stringsAsFactors = F)
ggplot(attendance, aes(x = year, y = number, fill = (Newport.Beach))) +
geom_bar(stat = 'identity', fill='darkred') +
theme_minimal() +
labs(x = '', y = '') +
theme(axis.text = element_text(size=25), panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank()) +
@underthecurve
underthecurve / attendance2.csv
Last active April 6, 2018 19:50
NICAR conference registration - updated with final 2018 numbers
year City number Chicago
1999 Boston 515
2000 Lexington 343
2001 NA
2002 Philadelphia 206
2003 Charlotte 261
2004 Cincinnati 335
2005 Hollywood 359
2006 Newark 324
2007 Cleveland 306
@underthecurve
underthecurve / 0_reuse_code.js
Created March 21, 2016 20:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@underthecurve
underthecurve / index.html
Created February 8, 2016 14:21
Chinese New Year Horoscopes 2016
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript">
// Get sign based on date
function getSign(date) {
date = new Date(date);
firstDate = new Date('02/05/1924');
@underthecurve
underthecurve / index.html
Created September 15, 2015 11:06
MMR test + circle
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<p>Not much to see here; try looking in the console!</p>
@underthecurve
underthecurve / mmr.csv
Created September 13, 2015 15:42
MDG Data on Maternal Mortality Ratio per 100,000 Live Births
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
IndicatorName,SeriesName,CountryName,ISO3Code,IsDeveloped,MdgRegions,IsLDC2014,IsLLDC,GDPpc2012,Population2012,Year,Value
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",Morocco,MAR,0,Northern Africa,0,0,"2,951.7",32521143,1990,310
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",Afghanistan,AFG,0,Southern Asia,1,1,682.8,29824536,1990,1200
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",Angola,AGO,0,Sub-Saharan Africa,1,0,"5,586.2",20820525,1990,1400
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",Albania,ALB,1,Developed,0,0,3809,3162083,1990,31
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",United Arab Emirates,ARE,0,Western Asia,0,0,"41,691.7",9205651,1990,16
5.1 Maternal mortality ratio,"Maternal mortality ratio per 100,000 live births",Argentina,ARG,0,Latin America,0,0,"11,610.2",41086927,1990,71
5.1 Maternal mortality ratio,"Maternal mortality rat