An interactive data visualization project analysing commuting trends, station crowding, and network robustness within Melbourne's metropolitan rail network.
- π Live Website: PTV Analyzer Dashboard
- π δΈζη README: README.zh.md
- π DEP Proposal: DEP_Proposal_Version2.pdf
- π DEP Report: DEP_Report.pdf
This repository contains the complete source code and documentation for the PTV Analyzer, a project developed as part of the FIT5147 unit at Monash University. The project is divided into two phases:
- Data Exploration Project (DEP): A comprehensive statistical analysis answering core research questions regarding train frequency, passenger volume fluctuations, and station crowding quantification. The findings are documented in the DEP Report.
- Data Visualisation Project (DVP): An interactive R Shiny web application built upon the findings of the DEP. It transforms static insights into an exploratory dashboard, allowing transport planners and general users to interact with the data through "Story Modes" and "Exploration Modes."
The project addresses two primary questions:
- Supply vs. Demand: How do train service frequency and passenger numbers fluctuate across different time periods (and weather conditions)?
- Station Crowding: How can we quantify station crowding (via the custom Station Crowding Index), and which stations are most affected by factors like time of day and infrastructure?
Based on the statistical analysis conducted in the Data Exploration Project, several critical insights into Melbourne's rail network were uncovered:
- Supply-Demand Mismatch: While trunk lines (e.g., Pakenham, Lilydale) experience severe capacity shortages during morning (07:00β09:00) and evening peaks, branch lines like Alamein show significant oversupply during mid-day off-peak hours, highlighting scheduling inefficiencies.
- Ridership Drivers: Machine learning modeling (Random Forest) reveals that Train Frequency is the dominant predictor of passenger volume. Contrary to common belief, weather factors (rain, temperature) have a negligible impact on ridership, whereas Solar Radiation (acting as a proxy for time-of-day) ranks second.
- The "City Loop" Bottleneck: Using the custom Station Crowding Index (SCI), City Loop stations (Flinders St, Southern Cross) show near-maximum crowding scores. However, the causes differ: Flinders Street is driven by passenger volume, while Southern Cross is driven by service frequency intensity.
- Temporal Shifts: Peak crowding occurs between 16:00β20:00 on weekdays. Notably, peak travel times shift significantly later on weekends and public holidays, with public holiday traffic volume averaging only 60% of a normal weekday.
The R Shiny dashboard translates the above findings into an interactive experience, featuring two distinct interaction modes: "Story Mode" for guided narrative and "Exploration Mode" for free-form analysis.
- Interactive Supply-Demand Analysis: Users can overlay train frequency density against passenger boarding density to visually identify service gaps across different lines and day types (Page 1.2).
- Station Crowding Heatmap: A geospatial visualization of the Station Crowding Index (SCI) across the network. Includes an animated hourly slider to observe how congestion hotspots migrate from suburbs to the city center throughout the day (Page 2.4).
- Network Robustness Simulator: An interactive network graph allowing users to simulate "station failures" (node removal). It calculates real-time metrics (e.g., Average Path Length, Diameter) to test the system's resilience against infrastructure disruptions (Page 2.5).
- City Loop Flow Visualization: An interactive Chord Diagram mapping the directional passenger flows between the six core City Loop stations, highlighting the dominance of outbound traffic from Flinders Street (Page 2.2).
- Predictive Model Playground: Allows users to toggle between Random Forest, Decision Tree, and Linear Regression models to see how different algorithms rank feature importance for ridership prediction (Page 1.3).
Below is the file structure of the repository.
2025-03-PTV-Analyzer-Website
ββ data # Data used for the Shiny website (Optimized/RDS format)
β ββ page_1.1_exploration_mode.rds
β ββ page_1.1_story_mode.rds
β ββ page_1.2_explore_public.rds
β ββ page_1.2_explore_school.rds
β ββ page_1.2_explore_weekday.rds
β ββ page_1.2_explore_weekend.rds
β ββ page_1.2_story_mode.rds
β ββ page_1.3_dt_importance.rds
β ββ page_1.3_lasso_importance.rds
β ββ page_1.3_lm_importance.rds
β ββ page_1.3_story_mode.rds
β ββ page_2.1_exploration_mode.csv
β ββ page_2.1_story1.csv
β ββ page_2.1_story2.csv
β ββ page_2.1_story3_story4.csv
β ββ page_2.2_cityloop_od_matrix.csv
β ββ page_2.3_2.4_station_stats.geojson
β ββ page_2.4_explore_mode_precomputed.rds
β ββ page_2.4_station_stats_with_station_type.geojson
β ββ page_2.4_train_lines_reference.geojson
β ββ page_2.4_train_line_labels.rds
β ββ page_2.5_filtered_edges.csv
ββ draft
β ββ DEP_Draft_Code.Rmd # Draft code for generating charts in the DEP Report
β ββ DVP_Draft_Code.Rmd # Draft code for generating charts in the DVP Website
ββ plot # Static figures used in the DEP Report
β ββ figure_1_1.png
β ββ figure_1_2.png
β ββ figure_1_3.png
β ββ figure_2_1.png
β ββ figure_2_2.png
β ββ figure_2_3.png
ββ LICENSE # MIT License
ββ README.md # Project documentation (English)
ββ README.zh.md # Project documentation (Chinese)
ββ report
β ββ DEP_Proposal_Version1.pdf # Initial DEP Proposal
β ββ DEP_Proposal_Version2.pdf # Final DEP Proposal (Current)
β ββ DEP_Report.pdf # Full Data Exploration Project Report
β ββ DVP_Presentation.pdf # "Five Design Sheet" used for DVP design process
β ββ DVP_Report.pdf # Data Visualisation Project Report
ββ rsconnect # Deployment configuration for shinyapps.io
β ββ shinyapps.io
β ββ zyyin1
β ββ ptv_analyzer.dcf
ββ global.R # Global configuration and library imports
ββ server.R # Shiny Server logic (Back-end)
ββ ui.R # Shiny UI layout (Front-end)
ββ www # Static assets (images, pre-generated plots)
ββ img1.jpg
ββ img2.jpg
ββ img3.jpg
ββ radar_png # Pre-generated radar charts for leaflet tooltips
ββ Aircraft.png
ββ Alamein.png
ββ ... (contains images for all stations)
ββ Yarraville.png
This R Shiny app was developed and tested under the following environments:
- Development environment: RStudio 2025.05.0+496 with R 4.4.3
- Tested environment: MoVE platform with RStudio 2024.12.1+563 and R 4.4.2
After installing all required packages, the app runs correctly on both environments. However, note that some visual elements (especially fonts and layout rendering) may appear slightly different on the MoVE platform.
To ensure the best viewing and performance experience, please follow these recommendations:
- Run the app locally if possible.
- Use RStudio 2025.05.0+496 and R 4.4.3.
- Before running the app, install all required packages. RStudio will automatically prompt to install CRAN packages.
Packages
chorddiagandggradarare not from CRAN and must be installed manually (see below). - Once the app is running, view it in Edge or Chrome and set your browser zoom level to 100% for proper layout rendering.
- Hope you enjoy.
This project uses two R packages that are not available on CRAN:
chorddiag: Used for interactive chord diagrams (Page 2.2).ggradar: Used for radar charts built onggplot2(Page 2.3 & 2.4).
These packages must be installed from GitHub before running the app.
You need the remotes package to install packages from GitHub:
install.packages("remotes")Then install the two packages:
# Install chorddiag from GitHub
remotes::install_github("mattflor/chorddiag")
# Install ggradar from GitHub
remotes::install_github("ricardo-bion/ggradar")The project utilizes four primary datasets sourced from the Victorian Government Open Data Portal and Data Vic.
- Description: This tabular dataset (CSV format) contains estimated passenger boarding and alighting counts for Melbourneβs rail services. With 15.6 million rows and 21 columns, it includes attributes such as Business Date, Day Type (e.g., weekday, public holiday), Line Name, Direction (toward/away from Flinders Street), and aggregated passenger counts (e.g., boardings, alightings).
- Usage: Spatial attributes like station coordinates and temporal granularity (hourly intervals) enable analysis of ridership trends and station-specific patterns. This dataset is used to address Questions 1 and 2.
- Description: This tabular dataset (CSV format) includes 138,538 rows of hourly weather observations. Key variables include precipitation, windspeed, air temperature, and relative humidity.
- Usage: These variables are merged with ridership data to assess weather impacts. Combined with Data Source A, this dataset helps answer Question 1 (regarding external factors).
- Description: This spatial dataset (GeoJSON format) provides geographic coordinates and metadata for 28,323 public transport stops across Victoria, including Melbourneβs rail network. Attributes include Stop ID, Stop Name, and Mode (e.g., Metro Train, Regional Train).
- Usage: It supports mapping station locations and integrating spatial context with the passenger dataset for visualisation.
- Description: Another spatial dataset (GeoJSON format) detailing 9,776 public transport routes, including rail lines. Attributes like Line Name, Headsign (destination), and Mode facilitate analysis of service coverage and connectivity.
- Usage: It complements the Stops dataset to contextualize passenger flows across the network spatially.
Zihan Yin
- Monash University
- Project Supervised by: Shivangi Gheewala & Michael Niemann
This project is for educational purposes as part of the Monash University FIT5147 unit.