Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
DC crime
#tell R where you're working
setwd("~/YourDataFolder")
#load libraries
library(ggplot2)
library(gdata)
#load data
crime <- read.csv("crime2012.csv")
#see summary statistics by offense
summary(crime$OFFENSE)
#create a new variable for a specific offense
theft <- subset(crime, OFFENSE == "THEFT/OTHER")
#plot the grid with 'facet_wrap'
qplot(HOUR, data = theft, binwidth = 1) + facet_wrap(OFFENSE ~ ANC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment