Skip to content

Instantly share code, notes, and snippets.

View kpq's full-sized avatar

Kevin Quealy kpq

View GitHub Profile
@kpq
kpq / index.html
Created March 24, 2016 01:21
Test block
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
/*css to go here*/
svg {
border: 1px solid #f0f;
}
circle {
st county STATE composite fipstxt FIPS count3
AK Aleutians East Alaska ak_aleutians east 02013 2013 0
AK Aleutians West Alaska ak_aleutians west 02016 2016 0
AK Anchorage Alaska ak_anchorage 02020 2020 19
AK Bethel Alaska ak_bethel 02050 2050 1
AK Bristol Bay Alaska ak_bristol bay 02060 2060 0
AK Denali Alaska ak_denali 02068 2068 0
AK Dillingham Alaska ak_dillingham 02070 2070 0
AK Fairbanks North Star Alaska ak_fairbanks north star 02090 2090 4
AK Haines Alaska ak_haines 02100 2100 0
@kpq
kpq / barley.tsv
Created February 1, 2016 22:58
NYC barley - Morris
yield variety year site
27 Manchuria 1931 University Farm
48.86667 Manchuria 1931 Waseca
27.43334 Manchuria 1931 Morris
39.93333 Manchuria 1931 Crookston
32.96667 Manchuria 1931 Grand Rapids
28.96667 Manchuria 1931 Duluth
43.06666 Glabron 1931 University Farm
55.2 Glabron 1931 Waseca
28.76667 Glabron 1931 Morris
@kpq
kpq / barley.tsv
Last active January 31, 2016 15:59
Barley Yields -- Crookston
27 Manchuria 1931 University Farm
48.86667 Manchuria 1931 Waseca
27.43334 Manchuria 1931 Morris
39.93333 Manchuria 1931 Crookston
32.96667 Manchuria 1931 Grand Rapids
28.96667 Manchuria 1931 Duluth
43.06666 Glabron 1931 University Farm
55.2 Glabron 1931 Waseca
28.76667 Glabron 1931 Morris
@kpq
kpq / index.html
Created January 31, 2016 15:38
Barley Yields, University Farm
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
/*css to go here*/
body {
font-family: arial;
font-size: 12px;
}
@kpq
kpq / index.html
Created January 26, 2016 02:09
A terrible rendering of Anscombe's quarter, No. 2
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
/*css to go here*/
.ancombe-chart {
border: 1px solid #f0f;
}
</style>
@kpq
kpq / README.md
Created November 19, 2013 04:54
basic state choropleth starter

A basic starter for UCB students who want to make a choropleth map. Nearly identical to Mike Bostock's many examples with counties.

@kpq
kpq / adoptions.R
Last active December 26, 2015 11:59
Scrape all U.S. adoptions by country of birth and year from the state department
get_country_data <- function(country_name) {
# this puts a plus instead of the space, which is how the URL behaves
country_name <- gsub(" ", "+", country_name)
#this fixes ivory coast
country_name <- gsub("`", "%60", country_name)
# first part of the url
first_part <- "http://adoption.state.gov/maps/statistics/map_files/statistics.php?special=NONE&year=ALL&country="
@kpq
kpq / gist:7034291
Last active December 25, 2015 20:19
in class data cleaning
library(maptools)
get_second_element <- function(item) {
return (item[2])
}
get_first_element <- function(item) {
return (item[1])
}
@kpq
kpq / README.md
Last active December 24, 2015 16:39
Basic bar chart

A basic bar chart syntax, based off the example publised by the NYT in their series about ESPN.