Skip to content

Instantly share code, notes, and snippets.

View jalapic's full-sized avatar

James Curley jalapic

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 58 columns, instead of 4 in line 3.
country,code,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015
Aruba,ABW,54208,55435,56226,56697,57029,57360,57712,58049,58385,58724,59065,59438,59849,60239,60525,60655,60589,60366,60106,59978,60096,60567,61344,62204,62831,63028,62644,61835,61077,61032,62148,64623,68235,72498,76700,80326,83195,85447,87276,89004,90858,92894,94995,97015,98742,100031,100830,101218,101342,101416,101597,101936,102393,102921,103441,104000
Andorra,AND,13414,14376,15376,16410,17470,18551,19646,20755,21888,23061,24279,25560,26892,28231,29514,30706,31781,32769,33746,34819,36063,37502,39112,40862,42704,44597,46515,48458,50431,52449,54511,56674,58904,61003,62707,63854,64291,64147,63888,64161,65399,67770,71046,74783,78337,81223,83373,84878,85616,85474,84419,82326,79316,75902,72786,70000
Afghanistan,AFG,8994793,91
@jalapic
jalapic / mouseexample.csv
Last active June 13, 2016 16:44
Mouse example data
Timestamp Actor Recipient
10/8/2015 12:02:06 5 9
10/8/2015 12:02:36 5 9
10/8/2015 12:03:53 5 2
10/8/2015 12:04:03 5 9
10/8/2015 12:06:45 5 8
10/8/2015 12:08:24 5 4
10/8/2015 12:10:24 5 6
10/8/2015 12:11:17 5 2
10/8/2015 12:12:31 3 5
"ZABAIBLABAEBAHAHABFABAFAGCEFABAGABFEJALAHAJAJABFACEALFACEACEALABFAOEAJAKEAEFAIDAJBACOEFAJALFAJAEGFJQEQEJBCJCEAIPIJAJAJHAICQDCQEAGAPGEQGQGAJGCQCAJAJHABALEACPGEAJHABGACFGCACIACAEGCEJAPCAJACECQGEFQFAJAJIAJAJAHAMBABCEFCAJCEQJAJALCECAECQECJGPCJAPEJABQGPBFJPABGCIJANJBCPQJMAOPCJPGJAJHAJBCEQCBHBEAJAJMHANAJAJACPEPFEJAJAHANHAHNCQEQFGEBJAPQCJAJBIZABABCACAJAQAPCPCQCGCQCQGCAHAPCPCACAPCPCQGCPCPCKCAJABPAHAQKPACQCPCQCGQCPCIHIHIPCAJAIPCPCPGCPAJAJABALKECALQPCKCICLCPCABAIKLKPCGCALGCACAKPQCPQCPCACPGCPCPCAJBKPCPCAMBKLZAHAHAHAHALAHAHAHAHAHAHAHAHAHAHAHAHKBKLALAOKBKLABAHAHAKAHAKBAHAHAHAOBKLOKBLOKBAHBKAHBKAHABAMAHAHAHAHAHAHAHAKRCRKLANHAHAHAKLRCQCRCBABKANAHAHAHBKBAKRCAKLKANBKANAHABKHANANAHBKLAMBIABKMAKBKAHAHBHBHAHAHBAHAHKAHAHIAHAHBKAHALKRCRCQRGCGCFCGCPCQCGPCGCGQGCGCQCQCGCGCGCGCPCGCGCPGPGCQCGCQCAKABKABKAHAHAHBKCGCGECGCGCQCABLAMALANHABKBKAHBKLABANHAHAKABKAMAHABRCQCQCECDGCGCGCFGCDCFCGCAJIPCEPGCGFDGECDGFCEGCGCGCGCAJAJBABAHAHAKAHABAHABKAMBAHABKAHAMHBAHABPGCGCEGCPEPGCLGEPCPGEGPGCGCIBECGCGCAJAJAHABABAKAMALCPCJAKLCGCGPECEGCDGCDGCFAJBAHAKABKQ
getcleandf1 <- function(df, dateformat="%m/%d/%Y %H:%M:%S"){
# 1. set up new behavior column ----
library(splitstackshape)
library(data.table)
library(dplyr)
library(devtools)
install_github('jalapic/engsoccerdata', username = "jalapic")
library(engsoccerdata)
library(dplyr)
head(england)
england$Date <- as.Date(england$Date, format="%Y-%m-%d")
#Get Data into Format Needed
@jalapic
jalapic / .block
Created May 16, 2016 00:04
Bump Plot
license: gpl-3.0
height: 800
border: none
@jalapic
jalapic / .block
Created May 11, 2016 02:13
Teaswarm
height: 500
border: yes
@jalapic
jalapic / README.md
Created May 11, 2016 01:20
chickens
@jalapic
jalapic / README.md
Created May 1, 2016 01:43
D3v4 Constraint-Based Layout

Organizing a network made of disconnected pieces like this one is improved by fixing those subgraphs into their own space on the canvas. A while back I showed how to do this using custom code in the tick() function of the D3v3 force layout as part of How to Create Effective Network Data Visualization.

Here's a much easier and cleaner way to do it using the new D3v4 force-layout by specifying a d3.forceY and d3.forceX that are associated with the node's module.

forked from emeeks's block: D3v4 Constraint-Based Layout

@jalapic
jalapic / README.md
Created April 24, 2016 19:18
scatter_slope

This is a scatterplot that transforms into a slopechart. The code is entirely built by Gerado Furtado. See here for full example.


This example was made to use as a template to make other scatterplot/slopechart transitions.

Built with blockbuilder.org