Skip to content
View privacy_policy_blogdiegovallenet.md

Privacy Policy

Last revised on 2015-08-16

The Gist

diegovalle.net will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

View first-nation-homicides.R
library("ggplot2")
library("gridExtra")
addSource <- function(plot, text = "") {
plot <- arrangeGrob(plot,
sub = textGrob(text,
x = 0, hjust = -0.1, vjust=0.1,
gp = gpar(fontface = "italic", fontsize = 9,
col = "gray30")))
return(plot)
View election2015.R
library(ggplot2)
library(dplyr)
library(readr)
library(rgeos)
library(maptools)
library(rgdal)
library(scales)
library(downloader)
#Download the latest version of the PREP
View mx_hexgrid.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View homicides-2013.Rmd
title output
Changes in homicide rates
html_document

I've updated the mxmortalitydb package to include 2013 data. This data only packages includes all injury intent deaths (accidents, homicides, suicides and unspcified intent) that were registered in Mexico from 2004 to 2013. You can use the package to calculate changes and trends in homicide rates in the most violent metro areas or big municipios.

#if (!require('devtools')) install.packages('devtools')
View ageb0.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View privacy_policy.markdown

Privacy Policy

Last revised on 2015-08-16

The Gist

hoyodecrimen will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

View json_to_csv.R
library("jsonlite")
library("dplyr")
library("magrittr")
library("stringr")
rnpe_c <- fromJSON('rnped_comun.json')
rnpe_c <- as.data.frame(rnpe_c$aaData, stringsAsFactors = FALSE)
rnpe_c$date <- as.Date(rnpe_c$fuerocomun_desapfecha, "%d/%m/%Y")
rnpe_c$tipo <- "comun"
rnpe_c$fuerocomun_desapentidad %<>% str_replace_all(" DE ZARAGOZA|ESTADO DE ", "")
View gist:8c8ce89af5efec8d14f6
--cuadrantes
with crimes as
(select sum(count) as count,sector,cuadrante,max(population)as population, crime from cuadrantes where date >= '2013-08-01' and date <= '2014-07-01' group by cuadrante, sector, crime)
SELECT * from (SELECT count,crime,sector,cuadrante,rank() over (partition by crime order by count desc) as rank,population from crimes group by count,crime,sector,cuadrante,population) as temp2 where rank <= (SELECT rank from (SELECT count,cuadrante,rank() over (partition by crime order by count desc) as rank, row_number() OVER (ORDER BY count desc) AS rownum from crimes) as rank10 where rownum = 10) order by crime, rank,sector, cuadrante
--sectores
with crimes as
(select (sum(count) / (sum(population) /12 )* 100000) as rate,sum(count) as count,sector,sum(population)/12 as population, crime from cuadrantes where date >= '2013-08-01' and date <= '2014-07-01' group by sector, crime)
SELECT * from (SELECT count,rate,crime,sector,rank() over (partition by crime order by rate desc) as rank,population f
View gist:0cf879df4e57359177f1
Verifying that +diegovalle is my Bitcoin username. You can send me #bitcoin here: https://onename.io/diegovalle
Something went wrong with that request. Please try again.