Skip to content

rcatlord/crime_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crime analysis in R

This growing repository contains scripts that enable users to load, tidy, manipulate, summarise and (interactively) visualise police recorded crime data in R.

Getting started

Download R from https://cran.r-project.org and load some sample crime data into your R session:

install.packages(c("tidyverse", "lubridate"))

library(tidyverse) ; library(lubridate)

crimes <- read_csv("https://raw.githubusercontent.com/rcatlord/crime_analysis/master/sample_data/crime_data.csv") %>% 
  mutate(date = ymd(date))

or just right-click on the 'Raw' button and download the CSV file:

raw

The data are crimes recorded by Greater Manchester Police between January and December 2015 which were downloaded from data.police.uk.

The scripts and shiny apps will work with any data downloaded from data.police.uk but they will need to share the same structure, i.e. be tidy first. Follow the tidying_data script for instructions.

The scripts

Data visualisations

There are several scripts to create simple data visualisations including Cleveland-style dotplots and calendar heatmaps.

Shiny apps

This repository includes several simple shiny apps that allow users to interactively visualise crime data.

Links

Releases

No releases published

Packages

No packages published