NYC taxi medallion analysis featured in my blog post NYC yellow cab trips: Neighborhood by neighborhood.
The following steps assume you have R, PostgreSQL, and PostGIS installed on your machine.
- Clone repo to local drive
- Download data into the
./1.Data
path - Run scripts in the
2.Code/1.DataPrep
path sequentially; if running from a shell, make sure the working directory is set to the project root, then run:
$ chmod +x 2.Code/1.DataPrep/0.PrepSchema.sh
followed by$ ./2.Code/1.DataPrep/0.PrepSchema.sh
$ Rscript 2.Code/1.DataPrep/1.UploadData.R
$ psql nyc-taxi-data -f 2.Code/1.DataPrep/2.FindRegion.sql
- Run the scripts in
2.Code/2.AnalysisNeighborhoods
; if running from a shell:
$ psql nyc-taxi-data -f 2.Code/2.AnalysisNeighborhoods/1.CreateViews.sql
chmod +x 2.Code/2.AnalysisNeighborhoods/2.MakeMaps.sh
followed by./2.Code/2.AnalysisNeighborhoods/2.MakeMaps.sh
Run time is approximately 3 days on my MacBook Pro.
All analysis beyond the setup described above can be found in the R Markdown source code for my post here. This code was knit into markdown for Jekyll with the knitr package.
Special thanks to to Todd Schneider for his instructions.