This code repository contains an app.R file along with the data_filtering.R file and a folder containing the data files used in the R visualization. The data_filtering.R file contains the code needed to create the files referenced in the data files folder. The app.R file contains all of the code needed to run this project. All the data from the .csv files comes from the Taxi Trips - 2019 dataset. Another .geojson file was also referenced in the app.R and data_filtering.R file which can be found here: Boundaries - Community Areas (current) dataset. This data is available from the Chicago Data Portal.
To run this project locally, make sure to clone this repo on your computer in whatever location you choose. Here are some simple steps below:
cd
git clone https://github.com/meganmehta/chicago-taxi.git
Along with cloning this repo, make sure to download R (v 4.1.2) and R Studio(v 2021.09).
Once you have R and R Studio downloaded, open this project file in R Studio. You can do this by setting the working directory: Session -> Set Working Directory -> Choose Directory
After the working directory is set, open the app.R file. Make sure that all necessary data files are available in the working directory.
Before running this application, make sure that all necessary packages/libraries are downloaded. To check what libraries are currently added, type the command
installed.packages()
in the R Studio Console. If some packages are missing, use install.packages("package-name-here")
to install the remaining ones necessary.
All of the needed libraries are listed at the top of the app.R file. The ggplot and leaflet packages are the most used ones in this project.
After that, you should be good to run the project. Click the 'Run App' button on the right. .
An additional window will pop up with the visualization and you're all set.
Here is the link to my deployed version! If you'd like to read more about the project details, check out the documentation here.