Saturday, October 11, 2014

GIS with R

Initially I tried QGIS, thinking that a system using a GUI interface would be quicker than one where you have to code and spend time figuring out syntax and data structures. WRONG! After crashes and a frustrating attempt to create a heat map, I switched to using R. Yes, figuring out which libraries to use and understanding the syntax took time, but I found it was still faster than trying to use QGIS.

I overlaid the Google maps image of San Francisco with the Police Districts shapefile, then colored the districts based on the frequency of violent crime in the area. The piece that took the most time was putting the district names at the center of each district, because I couldn't figure out how to get the latitude and longitude of shapefile centers. Eventually StackOverflow came to my rescue:

San Francisco PD Department Shapefile:

Here's the R Notebook:

I also did some non-GIS analysis, to whether crimes are reported more at certain times, which crimes are reported most frequencly, and whether certain Police Districts have a higher proportion of unresolved incidents.

Crime Frequency

Crimes by Hour

Monday, September 15, 2014

Frugal Grocery Shopping in West Hartford

I'm trying to cut our grocery bill - August came it at over $600 for two adults, and that doesn't even include several restaurant trips. This Friday I visited AppleTree and Aldi and came home with the following haul:


ItemUnit CostCost
Packham Pear.99/lb3.4
Black Plum.99/lb1.71
Green Squash.99/lb3.86
Loose Beets.79/lb3.17
Green Cabbage.99/lb2.32
Fuji Apples.99/lb4.18
Romain Lettuce1.79/lb1.2


ItemPrice Per UnitQuantityPrice
Corned Beef Hash1.5911.59
Frozen Peas0.9521.9
33.9 oz Coffee5.4915.49
Whole Chicken5.415.4
Gallon Whole Milk2.8912.89
Total with Tax29.04