Skip to content

Instantly share code, notes, and snippets.

Diego Valle-Jones diegovalle

Block or report user

Report or block diegovalle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@diegovalle
diegovalle / largefam.R
Last active Aug 29, 2015
Población femenina de 40 a 44 años de edad con 4 o más hijos nacidos vivos y que habla una lengua indígena
View largefam.R
require(ggplot2)
require(reshape)
require(stringr)
require(scales)
library(directlabels)
hom <- read.table(text="2010 2000 state
0.589481859 0.7044360966 Total
0.4050632911 0.4418604651 Aguascalientes
0.5746496039 0.6178509532 Baja California
@diegovalle
diegovalle / conyugal.R
Last active Aug 29, 2015
Población femenina de 40 a 44 años de edad por situación conyugal
View conyugal.R
require(ggplot2)
require(reshape)
require(stringr)
require(scales)
hom <- read.table(text="Sin escolaridad Educación básica Educación media superior Educación superior Estudios técnicos o comerciales con preparatoria terminada Normal de licenciatura Profesional Maestría Doctorado
0.1333900264 0.0866986092 0.1203814875 0.1677704297 0.1350452061 0.1673361018 0.1723742877 0.2003161063 0.2381625442
0.4782996145 0.6043175271 0.6266342786 0.6165165611 0.6309864938 0.6017564164 0.6192202588 0.5912486197 0.5414840989
0.2509738821 0.1739237235 0.1075405894 0.076660514 0.0937652362 0.0858057049 0.0711621725 0.0664256176 0.0792932862
0.0728234689 0.082743796 0.0742778733 0.0565067911 0.067043598 0.0648512492 0.0533251335 0.0454456882 0.0493286219
@diegovalle
diegovalle / estudios.R
Last active Aug 29, 2015
Número promedio de hijos nacidos vivos por grado de estudios
View estudios.R
require(ggplot2)
require(reshape)
require(stringr)
hom <- read.table(text="Sin escolaridad Educación básica Educación media superior Educación superior Estudios técnicos o comerciales con preparatoria terminada Normal de licenciatura Profesional Maestría Doctorado
4.3590760723 3.271073644 2.2923336285 1.8956866673 2.1159363265 1.9962284703 1.8477515858 1.655703986 1.5113780919
", sep = "\t", row.names = NULL, header=TRUE,
colClasses = "numeric")
names(hom)[1] <- "Sin.escolaridad"
@diegovalle
diegovalle / religion.R
Created May 8, 2014
Education and Religion in Mexico
View religion.R
library(reshape)
library(ggplot2)
library(scales)
library(stringr)
hom <- read.table(text="Total,Católica,Ortodoxos,Anabautista - Menonita,Anglicana,Bautista,Iglesia del Nazareno,Luterana,Metodista,Presbiteriana,Otras protestantes,Pentecostales,Cristianas y Evangélicas sin sustento actual pentecostal,Adventistas del Séptimo Día,Iglesia de Jesucristo de los Santos de los Últimos Días (Mormones),Testigos de Jehová,Budismo,Hinduismo,Otras Orientales,Judaica,Islámica,Raíces étnicas,Espiritualistas,Otras religiones,Sin religión,No especificado
84927468,71279088,4327,7020,2908,189744,30246,2100,20464,316260,40465,1297314,4409550,492755,245641,1228239,12673,1653,1880,53880,3226,19090,29910,12343,4008693,1217999
7855312,6692152,1902,51,1010,16587,1819,972,4486,14824,8847,35932,393181,25961,36803,52871,5810,783,691,15712,1461,1662,4100,2480,454844,80371
", sep = ",", row.names=NULL, header=TRUE,
View keybase.md

Keybase proof

I hereby claim:

  • I am diegovalle on github.
  • I am diegovalle (https://keybase.io/diegovalle) on keybase.
  • I have a public key whose fingerprint is 76B3 74CF AFB9 E863 1313 83A8 55BD 9EC4 CD81 C252

To claim this, I am signing this object:

@diegovalle
diegovalle / key.asc
Last active Feb 22, 2019
PGP PUBLIC KEY - Diego Valle-Jones
View key.asc
-----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 Jan 24, 2019
Projected Topojson of Mexican Municipalities
View README.md

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 Aug 29, 2015
Animated choropleth of homicide rates in Mexico 1997-2013
View index.html
<!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 Jan 4, 2016
Datos del contador ciclista ubicado en Reforma 222
View contador_bici.R
## 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 Dec 31, 2015
Changes in homicide rates
View change-report.Rmd
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)
You can’t perform that action at this time.