This file contains hidden or 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(engsoccerdata) | |
library(dplyr) | |
m <- table(engsoccerdata2$home, engsoccerdata2$visitor) %>% as.data.frame.matrix %>% as.matrix | |
m1 <- m + t(m) | |
d<-dist(m1) | |
library(MASS) | |
fit <- isoMDS(d, k=6) | |
x <- fit$points[,1] |
This file contains hidden or 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
x | y | |
---|---|---|
2 | 90 | |
7 | 15 | |
15 | 3 | |
18 | 58 | |
20 | 20 | |
19 | 33 | |
36 | 4 | |
36 | 5 | |
37 | 19 |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or 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
year,pct,ser_num,datestop,timestop,recstat,inout,trhsloc,perobs,crimsusp,perstop,typeofid,explnstp,othpers,arstmade,arstoffn,sumissue,sumoffen,compyear,comppct,offunif,officrid,frisked,searched,contrabn,adtlrept,pistol,riflshot,asltweap,knifcuti,machgun,othrweap,pf_hands,pf_wall,pf_grnd,pf_drwep,pf_ptwep,pf_baton,pf_hcuff,pf_pepsp,pf_other,radio,ac_rept,ac_inves,rf_vcrim,rf_othsw,ac_proxm,rf_attir,cs_objcs,cs_descr,cs_casng,cs_lkout,rf_vcact,cs_cloth,cs_drgtr,ac_evasv,ac_assoc,cs_furtv,rf_rfcmp,ac_cgdir,rf_verbl,cs_vcrim,cs_bulge,cs_other,ac_incid,ac_time,rf_knowl,ac_stsnd,ac_other,sb_hdobj,sb_outln,sb_admis,sb_other,repcmd,revcmd,rf_furt,rf_bulg,offverb,offshld,forceuse,sex,race,dob,age,ht_feet,ht_inch,weight,haircolr,eyecolor,build,othfeatr,addrtyp,rescode,premtype,premname,addrnum,stname,stinter,crossst,aptnum,city,state,zip,addrpct,sector,beat,post,xcoord,ycoord,dettypCM,lineCM,detailCM | |
2014,67,15,1012014,2330,1,O,P,1,FEL,5,V,Y,Y,N, ,N, ,0,0,N, ,Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N, |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or 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
"year","pct","datestop","timestop","arstmade","frisked","searched","contrabn","sex","race","dob","age","stinter","crossst","city","addrpct","sector","xcoord","ycoord" | |
2014,67,1012014,2330,"N","Y","N","N","M","B",12311900,"18","CHURCH AVENUE","EAST 39 STREET","BROOKLYN",67,"G",1000633,176542 | |
2014,7,1032014,1530,"Y","Y","Y","N","M","B",12311900,"31","ESSEX STREET","DELANCEY STREET","MANHATTAN",7,"B",987521,201066 | |
2014,84,1042014,2100,"N","Y","N","N","M","B",12311900,"16","FULTON STREET","WILLOUGHBY STREET","BROOKLYN",84,"F",988579,191174 | |
2014,84,1092014,1250,"N","Y","N","N","M","A",12311900,"19","GOLD STREET","BRIDGE STREET","BROOKLYN",84,"D",988827,194808 | |
2014,77,1092014,1310,"N","N","N","N","M","B",12311900,"32","RALPH AVENUE","BERGEN STREET","BROOKLYN",77,"J",1005873,185052 | |
2014,44,1152014,2220,"Y","Y","Y","N","M","B",12311900,"22","CLAY AVENUE","TELLER AVENUE","BRONX",44,"R",1009416,244229 | |
2014,66,1172014,2200,"N","Y","N","N","M","B",12311900,"32","SUBWAY BROOKLYN BMT","55 STREET","BROOKLYN",66,"D",NA,NA | |
20 |
This file contains hidden or 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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Loading Stop and Frisk CSV Data with D3</title> | |
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script> | |
</head> | |
<body> | |
<p>Here are the Stop and Frisk Data for NYC 2014</p> |
This file contains hidden or 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> | |
<html> | |
<head> | |
<title>Arrows</title> | |
<meta charset="utf-8" /> | |
<script src="http://d3js.org/d3.v3.js"></script> | |
</head> |
This file contains hidden or 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> | |
<html> | |
<head> | |
<title>Arrows</title> | |
<meta charset="utf-8" /> | |
<script src="http://d3js.org/d3.v3.js"></script> | |
</head> |
This file contains hidden or 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> | |
<html> | |
<head> | |
<title>Arrows</title> | |
<meta charset="utf-8" /> | |
<script src="http://d3js.org/d3.v3.js"></script> | |
<style> |
This file contains hidden or 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
/* | |
* heatmap.js v2.0.0 | JavaScript Heatmap Library | |
* | |
* Copyright 2008-2014 Patrick Wied <[email protected]> - All rights reserved. | |
* Dual licensed under MIT and Beerware license | |
* | |
* :: 2014-08-05 01:42 | |
*/ | |
(function(a){var b={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};var c=function i(){var a=function d(a){this._coordinator={};this._data=[];this._radi=[];this._min=0;this._max=1;this._xField=a["xField"]||a.defaultXField;this._yField=a["yField"]||a.defaultYField;this._valueField=a["valueField"]||a.defaultValueField;if(a["radius"]){this._cfgRadius=a["radius"]}};var c=b.defaultRadius;a.prototype={_organiseData:function(a,b){var d=a[this._xField];var e=a[this._yField];var f=this._radi;var g=this._data;var h=this._max;var i=this._min;var j=a[this._valueField]||1;var k=a.radius||this._cf |
This file contains hidden or 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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Adding Tooltips</title> | |
<h1>Stop and Frisk Totals by Race for NYC in 2014 </h1> | |
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script> | |
<style type="text/css"> |