Skip to content

Instantly share code, notes, and snippets.

@gfrmin
Created November 12, 2014 09:02
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 gfrmin/a29c2d77b96605d37617 to your computer and use it in GitHub Desktop.
Save gfrmin/a29c2d77b96605d37617 to your computer and use it in GitHub Desktop.
police <- police[!grep("total",Result)][`Major Category` != "All"][,!c("Total.2012/13","Total.2011/12"),with=FALSE]
police <- gather(police, key, number, -Result, -`Major Category`)
police <- separate(police, key, into=c("Complaint", "Year"), sep="\\.")
police[,Result := factor(Result, levels = unique(police$Result))]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment