Skip to content

Instantly share code, notes, and snippets.

View jalapic's full-sized avatar

James Curley jalapic

View GitHub Profile
@jalapic
jalapic / README.md
Created September 24, 2015 00:41
slope, one transition

Slope Chart

  • this slope chart will transition from one set of data to another on click of the update button.

To do:

  • enable going back to original data on re-click
  • color gradient based on difference between y1,y2
@jalapic
jalapic / README.md
Last active September 24, 2015 01:32
slope, 2 transitions

Transitioning Slope Chart

This slope chart transitions between two y-axes

  • has options for hovering to pick out line/circle combinations
@jalapic
jalapic / README.md
Last active September 24, 2015 03:07
NHL Slope Graph

NHL slope graph

A slope graph showing how total points and shots per game changed from 2013/14 to 2014/15

@jalapic
jalapic / gist:47b0be9cff2732267949
Created September 30, 2015 16:53
NHL Small Multiple
# Making an NHL Small Multiple
# this is only minimally annotated - sorry
# Libraries we'll use
library(dplyr)
library(magrittr)
library(XML)
library(ggthemes)
library(ggplot2)
@jalapic
jalapic / viridisschiz
Created October 3, 2015 01:27
Australian Schizophrenia Births
### Example Viridis Plot
library(ggplot2)
library(viridis)
library(season)
library(gridExtra)
pa<-ggplot(schz, aes(year, month, fill = SczBroad)) +
geom_tile(colour="gray20", size=1.5, stat="identity") +
scale_fill_viridis(option="A") +
#Geom Tiling
df <- data.frame(Var1=rep(LETTERS[1:20],20),
Var2=rep(LETTERS[1:20],each=20),
Value=sample(1:100, replace=T, 400)
)
@jalapic
jalapic / README.md
Last active October 5, 2015 22:14
Time Series
### Earnings Dumbbell Chart
library(ggplot2)
library(tidyr)
library(dplyr)
library(scales)
schoolearnings <- read.csv("schoolearnings.csv", stringsAsFactors=FALSE)
df <- schoolearnings %>% gather(gender,value,2:3)
@jalapic
jalapic / dimpleshiny
Created October 27, 2015 03:52
dimple & shiny
library(shiny)
library(dplyr)
library(rcdimple)
library(htmltools)
## INTERACTIVE APP
ex_data <- read.delim(
"http://pmsi-alignalytics.github.io/dimple/data/example_data.tsv"
)
@jalapic
jalapic / README.md
Created November 7, 2015 18:45
Simple Correlation Matrix - Labels Above Cells