Skip to content

Instantly share code, notes, and snippets.

@ckholmes5
Created July 22, 2016 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckholmes5/0d868f74b4387758b8d76e6a5c3fd3a5 to your computer and use it in GitHub Desktop.
Save ckholmes5/0d868f74b4387758b8d76e6a5c3fd3a5 to your computer and use it in GitHub Desktop.
statemerge = merge(statecrime, stateexpense, by=c('Year','State'))
statemerge = mutate(statemerge, Educ_per_person = Total_Educ_Total_Exp/Population.x,
Police_per_person = Police_Prot_Total_Exp/Population.x,
Violent_rate = Violent.crime.total/Population.x,
Property_rate = Property.crime.total/Population.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment