Skip to content

Instantly share code, notes, and snippets.

View diegovalle's full-sized avatar

Diego Valle-Jones diegovalle

View GitHub Profile
@diegovalle
diegovalle / key.asc
Last active February 16, 2021 15:52
PGP PUBLIC KEY - Diego Valle-Jones
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFNoG6gBEADUb3F7iVz7k6yt5oVipTv4F0kg6SUoBEPcU/sSwwu40XLyDRm2
fVOgdsr5lWYTpcq4JWOk7S27IOTknZpWMNetdb3XHHdATWoHSEln3acIvZWQxmQ8
nJFIKfgM4WbWBPQMFXs9KU5FrBJC/iETzlgv7yFfvp1eBfz57fUNAE3ZQ496du9w
VPiXscN7Q49KCz/V/QE59agiokEbLpnVC2q8kjM+ydjSjEUNTvqwJPBek6KQDkHT
rHiEw/JKA+/P3FrDdp2LFtLpKmbgOviqV1+2GtQE16qjA0FfsoA3pK9wJeu21Qtv
vajY+Oe864TFkOJG/fO07RzsTfqA63FfDPtm+s/j18OcISab1DPk6guEmTOTqEsB
RAUMUiMyu7HawCSob6vwYrNsRlU6S/KFnC2AlWOfpBStq1tiEbqo/fGn2I84744o
J6eCyP15qG0NbFt+tF53iEMRVPG+VH40v1nymPbe5xUdcvj6kv/1A46PM0zBmM60
@diegovalle
diegovalle / README.md
Last active January 24, 2019 20:46
Projected Topojson of Mexican Municipalities

Projected topojson example of a choropleth of Mexican municipalities and states with tooltips and each municipality colored by the number of people who live there

First download the shapefiles of Mexico (AGEBs, Manzanas, Municipios, Estados, etc) 1.4GB from

http://www.diegovalle.net/projects.html#url=%23datasets

Then convert the files 'shps/national/national_municipal.shp' and 'shps/national/national_estatal.shp' to topojson with

@diegovalle
diegovalle / index.html
Last active August 29, 2015 13:56
Animated choropleth of homicide rates in Mexico 1997-2013
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='http://d3js.org/topojson.v1.min.js' type='text/javascript'></script>
<script src='http://datamaps.github.io/scripts/datamaps.all.min.js' type='text/javascript'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js' type='text/javascript'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js' type='text/javascript'></script>
@diegovalle
diegovalle / contador_bici.R
Last active January 4, 2016 13:09
Datos del contador ciclista ubicado en Reforma 222
## Datos del contador ciclista ubicado en Reforma 222. El contador
## sólo opera en dirección Centro
## Author: Diego Valle
## Web: www.diegovalle.net
library(ggplot2)
library(lubridate)
library(stringr)
library(mgcv)
library(rCharts)
@diegovalle
diegovalle / change-report.Rmd
Last active December 31, 2015 14:09
Changes in homicide rates
Changes in homicide rates
========================================================
Look, another example of using the [mxmortalitydb](https://github.com/diegovalle/mxmortalitydb) package! Changes and trend in homicide rates in the most violent metro areas or big municipios (note the log scales). For comparison the homicide rate in Chicago (metro area) was 8.2
```{r}
library(mxmortalitydb)
library(stringr)
library(plyr)
library(ggplot2)
@diegovalle
diegovalle / mapa_digital_5.0.A.sh
Last active December 29, 2015 14:39
Download the shapefiles contained in the Marco geoestadístico 2010 versión 5.0.A
#! /bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Purpose: Download the shapefiles contained in the Marco geoestadístico 2010 versión 5.0.A
# comunicaciones y transportes
# cultura
# curvas de nivel
# hidrografia
@diegovalle
diegovalle / download-mapa-digital.sh
Last active June 11, 2020 00:36
Download the shapefiles contained in the Mapa Digital de México
#! /bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Purpose: Download the shapefiles contained in the Mapa Digital de México
# comunicaciones y transportes
# cultura
# curvas de nivel
# hidrografia
@diegovalle
diegovalle / download-census-shp.sh
Last active May 20, 2019 19:20
Download shapefiles at the census tract and block level for all of urban Mexico—more than 5 GB of data!
#!/bin/bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Purpose: Download shapefiles of manzanas (blocks), agebs (census areas), ejes
# viales (streets), interesting areas and a whole bunch of other stuff
# Note that you'll need a recent version of innoextract
# http://constexpr.org/innoextract/, one that can work with files
# created by version 5.5 of Inno Setup, the one in Ubuntu universe is
# not recent enough. The version available at
@diegovalle
diegovalle / .block
Last active August 2, 2017 16:47
Density map of homicides in Monterrey
license: mit
@diegovalle
diegovalle / README.md
Last active December 14, 2015 21:58
Cartograma No Contiguo de Averiguaciones Previas por Homicidio