Skip to content

Instantly share code, notes, and snippets.

View walkerke's full-sized avatar

Kyle Walker walkerke

View GitHub Profile
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://dimplejs.org/dist/dimple.v1.1.3.min.js' type='text/javascript'></script>
<style>
.rChart {
@walkerke
walkerke / index.html
Created January 30, 2014 22:26
Remittances
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://dimplejs.org/dist/dimple.v1.1.3.min.js' type='text/javascript'></script>
<style>
.rChart {
@walkerke
walkerke / index.html
Last active August 29, 2015 13:55
Banana exports
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://dimplejs.org/dist/dimple.v1.1.3.min.js' type='text/javascript'></script>
<style>
.rChart {
@walkerke
walkerke / index.html
Last active August 29, 2015 13:55
Banana exports, top 10 countries
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://dimplejs.org/dist/dimple.v1.1.3.min.js' type='text/javascript'></script>
<style>
.rChart {
@walkerke
walkerke / index.html
Last active August 29, 2015 13:56
TFR by country in Europe since 1960
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/src/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v2.min.js' type='text/javascript'></script>
<script src='http://nvd3.org/nv.d3.js' type='text/javascript'></script>
<script src='http://nvd3.org/lib/fisheye.js' type='text/javascript'></script>
@walkerke
walkerke / index.html
Created February 23, 2014 11:27
Population over age 65 in Europe by country since 1960
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/src/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/lib/fisheye.js' type='text/javascript'></script>
@walkerke
walkerke / index.html
Created March 6, 2014 17:29
Total fertility rates in Europe since 1960
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='http://nvd3.org/src/nv.d3.css'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='http://nvd3.org/lib/fisheye.js' type='text/javascript'></script>
library(WDI)
library(rCharts)
library(plyr)
countries <- c("AL", "AT", "BE", "BA", "BG", "HR", "CZ", "DK", "FI", "FR", "DE", "GR",
"HU", "IS", "IE", "IT", "NL", "NO", "PL", "PT", "RO", "RS", "SK", "SI",
"ES", "SE", "CH", "GB")
tfr <- WDI(country = countries, indicator = "SP.DYN.TFRT.IN", start = 1960, end = 2011)
@walkerke
walkerke / index.html
Last active August 29, 2015 14:02
Line with multiple colors in dimple/rCharts
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://dimplejs.org/dist/dimple.v1.1.5.min.js' type='text/javascript'></script>
<style>
.rChart {
@walkerke
walkerke / code.R
Last active August 29, 2015 14:02
Line with multiple colors in dimple/rCharts
library(rCharts)
myvalue <- c(16, 18, 5, 14, 10)
myXaxis <- c(1,2,3,4,5)
mygroup <- c(1, 1, 1, 2, 2)
mydf <- data.frame(myvalue, myXaxis, mygroup)
d1 <- dPlot(
myvalue ~ myXaxis,
data = mydf,