This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("zoo") | |
require("ggplot2") | |
# unemployment | |
u <- read.csv("Employment.csv", header=T) | |
u <- melt(u, "Year") | |
unemployment <- data.frame(date=as.yearmon(do.call(paste, u[,1:2]), "%Y %b"), | |
rate=u$value) | |
unemployment <- unemployment[unemployment$date > as.yearmon("2008-12"),] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("jsonlite") | |
library("stringr") | |
oauth <- scan("yourOAuth.token", "character") | |
getCMD <- function(user){ | |
# crude system command for querying Github API | |
newcmd <- paste0("curl -H 'Accept: application/vnd.github.v3.text-match+json Authorization: token ", | |
oauth, "' 'https://api.github.com/search/code?q=set.seed+in:file+language:R+user:", | |
user,"&page=1&per_page=500' | grep 'fragment' -") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("ggplot2") | |
library("scales") | |
## Data: http://www.theguardian.com/news/datablog/2009/oct/21/icm-poll-data-labour-conservatives#data (State of the parties spreadsheet) | |
# ICM poll resultsof ~1000 people taken every month or so | |
# (more often before an election) as well as election | |
# results dating from June 1984. | |
sop <- read.csv("StateOfTheParties.csv", stringsAsFactors=F) | |
## Data cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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.1.min.js' type='text/javascript'></script> | |
<style> | |
.rChart { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<link rel='stylesheet' href='http://nvd3.org/assets/css/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/assets/lib/fisheye.js' type='text/javascript'></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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.1.min.js' type='text/javascript'></script> | |
<style> | |
.rChart { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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.1.min.js' type='text/javascript'></script> | |
<style> | |
.rChart { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 { |
OlderNewer