This project was made to visualize the location and ridership of CTA stations over time. It is hosted on https://tonyl.shinyapps.io/424_proj2/ It was designed to run on a double wide screen so if you are running on an HD monitor it is recommended you zoom out to 50%.
A bar chart showing the ridership at all CTA stations for the date of August 8th 2021, the first day of instruction at UIC. Its order is originally in alphabetical order. however it an be sorted in descending order by ridership using the radio buttons in the center.
The map displays the same information, however the ridership is represented by the size of the circle and the circles are placed in the location of the stations. The background can be switched between 3 different styles with differing information. The default is a large font and high contrast road style, there is also a simple view which deemphasizes the font and the contrast of the roads, finally there is a background which shows the most detail such as the names of business/building as well as markers for amenities and businesses.
The central table displays the same information a final time, however it gives you exact information about each station's ridership.
These bar charts and their respective tables show information for a single station at at time. The top left shows ridership as it changes year by year for that station. The bottom left shows the ridership per day. The top right shows ridership over a selected year aggregated by month. December 2021 has not been logged yet so it is missing. The bottom right chart shows how ridership changes depending on the day of the week, it is aggregated over the selected year.
The controls are all placed in the center middle of the screen. The first control selects the year that the bar charts on the right side of the screen will show. The next is a selection of radio buttons which change the background of the map as referenced in the section Map. Below that is a switch between alphabetical and ridership sort for the bar chart which shows all the stations together. Finally The last section allows the user to select between using a single date to select data or a range of data and showing the difference in ridership between those two dates. There are also two buttons which can be used in the single date selection which allows the user to quickly increment or decrement the single date selection by one day. The final control is attached to the map, selecting any circle displayed on the map will select that station and display that sections information on the right side bar charts.
Data was retrieved from:
https://data.cityofchicago.org/Transportation/CTA-Ridership-L-Station-Entries-Daily-Totals/5neh-572f
https://data.cityofchicago.org/Transportation/CTA-System-Information-List-of-L-Stops/8pix-ypme
The first link is used to gather all of the information about ridership per station, it contains data from January 2001, to November 2021 for each station.
The second link contains information about each current station and its location(latitude, longitude). It does not contain information about closed stations, this will be addressed later.
Shiny.io only allows files to be a maximum size of 5MB, because of this we cannot upload the ridership tsv without parsing it into smaller files and removing some information. To do this the column "daytype" was dropped and the file was split in to 21 TSV's referring to each year from 2001 to 2021, each is about 4MB.
The second file fit within the 5MB limit already however it had a lot of repeated data such as line information and ID numbers, these were dropped. In addition to this some stations which have been closed were added manually those stations were, Randolph/Wabash, Madison/Wabash, Washington/State, and Homan.
These conversions were done in a python script utilizing pandas.
The files of this project can be found at the github linked here: https://github.com/otny12/424_proj2
The R Shiny can also be run locally.
Install R-studio from https://www.rstudio.com/
Install R version 4.1.2 from https://www.r-project.org/
required packages can be installed using "install.packages("package")
replace package with: shiny, leaflet, ggplot2, lubridate, DT, scales, htmltools
Run the app.R file then open a web browser to the local ip.
One thing that this visualization can achieve quickly is its ability to view outliers. The below visualization displays the date range of August 27th 2021, to August 28th 2021, a Friday and Saturday respectively. Zooming the map into the Chicago Downtown, often referred to as Loop due to the elevated train tracks which loop around it. We can see that all the loop stations decrease in their use moving from Friday to Sunday, except for the station State and Lake which is still big and blue.
Switching the view to Amenities and zooming in further on the map we can see why people may be going to State and Lake on the weekends, There are services such as hotels, restaurants and shopping malls near by, all of which may have more use during the weekend when people have more free time.
Another thing that this can show well are trends over time. The display below shows how the ridership changed over the 2016 year. You can see that the chart skews heavily towards a decrease in ridership.
Looking at the chart on the right we can see that the station which saw the greatest decrease in 2016 was Grand and State. We can then select the station using the map and change the selected year to 2016, In the top left barchart we can see that there was indeed a decrease from 2016 to 2017 and we can see ridership in December dip below the starting ridership in January.
Something that is provided by the next day features is we can quickly switch between days and compare how the rankings of stations changes on depending on the day. The below charts show how the top places change, they are 3 consecutive days in 2010, starting on February 4th. You can see how Lake and State, and Clark and Lake are the two most used stops, however that changes on the weekend when Chicago and State becomes the most used stop and clark and lake drops into the upper half of the barchart.