Skip to content

Instantly share code, notes, and snippets.

@cavedave
cavedave / Ireland Population Pyramid.r
Last active September 16, 2016 16:27
Ireland population pyramid based on code from https://gist.github.com/walkerke/f9665e15b74b393bd2d6
library(idbr) # devtools::install_github('walkerke/idbr')
library(ggplot2)
library(animation)
library(dplyr)
library(ggthemes)
idb_api_key("")
@cavedave
cavedave / SeaIceRegression.r
Last active September 19, 2016 15:49
Regression on when there will be no sea ice
#get the the most recent day
#1. Get Data: I downloaded the data from these ftps
#ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/data/NH_seaice_extent_final_v2.csv
#ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/data/NH_seaice_extent_nrt_v2.csv
nisdc1 = read.csv("NH_seaice_extent_final_v2.csv",skip=2,col.names=col.names)
nisdc2 = read.csv("NH_seaice_extent_nrt_v2.csv",skip=2,col.names=col.names)
#2. load libraries
library(dplyr)
library(tidyr)
@cavedave
cavedave / NBAPLayers
Last active September 30, 2016 20:20
---
title: "Basketball Size"
output: html_notebook
gif is up at http://imgur.com/dobmMWM
---
This is a copy of this NFL visualisation.<http://noahveltman.com/nflplayers/>
I couldnt find the R code to recreate it. I could find data for basketball at <https://github.com/simonwarchol/NBA-Height-Weight>.
First get Simon Warchols data and stitch his csvs together
@cavedave
cavedave / london2015d.csv
Last active October 5, 2016 13:35
Make a map of where a logo turtle would be pushed by the wind in the major cities. This takes direction and strength ad noon each day and draws a line. Initially just an image but maybe a video later. Data is from http://brightdata.brightwindanalysis.com/ Inspired by Richard Long: Circle of Autumn Winds, 1994 http://www.stedelijk.nl/kunstwerk/30…
Date Time WS50m_m/s WD50m_deg T2M_degC PS_hPa
01/01/2015 12:00:00 12.773 206 7.66 1018.75
02/01/2015 12:00:00 10.259 275 8.01 1021.34
03/01/2015 12:00:00 1.895 257 6.14 1005.35
04/01/2015 12:00:00 1.98 232 2.79 1026.29
05/01/2015 12:00:00 5.994 212 7.96 1018.73
06/01/2015 12:00:00 8.564 242 9.53 1008.69
07/01/2015 12:00:00 9.663 203 7.32 1014.26
08/01/2015 12:00:00 7.525 288 7.51 1010.45
09/01/2015 12:00:00 13.216 255 10.47 1010.38
@cavedave
cavedave / README.md
Last active January 17, 2017 21:13
World Births per Woman Test
@cavedave
cavedave / README.md
Last active January 18, 2017 09:16
War Deaths in the World Each Year
@cavedave
cavedave / README.md
Last active January 18, 2017 09:51
World Life Expectancy
@cavedave
cavedave / README.md
Last active January 3, 2022 20:40
When will the Carnage end?

"This American carnage stops right here and stops right now." Donald Trump

Draw for yourself the pattern of how many people are murdered in the US each year

This code was made by Adam Pearce and the data comes from Homicide Trends in United States

"This American carnage stops right here and stops right now." Donald Trump

Draw for yourself the pattern of how many people are murdered in the US each year

This code was made by Adam Pearce and the data comes from Homicide Trends in United States

@cavedave
cavedave / README.md
Last active January 1, 2020 09:24
How much do people spend and on what?