/NYC_taxi

NYC taxi medallion analysis

Primary LanguageRMIT LicenseMIT

NYC_taxi

NYC taxi medallion analysis featured in my blog post NYC yellow cab trips: Neighborhood by neighborhood.

Setup

The following steps assume you have R, PostgreSQL, and PostGIS installed on your machine.

  1. Clone repo to local drive
  2. Download data into the ./1.Data path
  3. 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
  1. 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.

Analysis

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.

Credit

Special thanks to to Todd Schneider for his instructions.