I thought I would have a look at some open data and I came across the crime data set. The data used is:
Using R
I thought this was a good opportunity to practise some R skills, though it could have easily been accomplished in Python as well. In order to read the data into R “nicely” I saved the relevant data into csv
format. There wasn’t really anything tricky, though I did discover this neat code in stats.stackexchange
agg <- by(dx, dx$ID, FUN = function(x) x[1, ])
# Which returns a list that you can then convert into a data.frame thusly:
do.call(rbind, agg)
What this code does is take the first observation by a particular grouping (similar to proc sort nodupkey
in SAS
).
Using Tableau
I made a screencast on how I used Tableau. The video is cut it out rather abruptly and the sound quality isn’t great, but I suppose you just have to made do with what you’ve got! Overall this project was far simpler than what I imagined and I’m reasonably pleased with the results.