Analyses voting patterns from the 2025 Australian Federal Election.
Highlights total votes and voting methods by state.
Data sourced from the Australian Electoral Commission (AEC).
HouseVotes_State.csvStateNm: State nameEligibleElectors: Registered votersTotalVotes: All votes countedPostalVotes, PrePollVotes,
AbsentVotes, OrdinaryVotes, etc.ggplot(data, aes(x = reorder(StateNm, TotalVotes), y = TotalVotes, fill = StateNm)) +
geom_col(show.legend = FALSE) +
geom_text(aes(label = scales::comma(TotalVotes)), hjust = -0.1, size = 5) +
coord_flip() +
labs(title = "Total Votes Counted by State in 2025",
subtitle = "Data sourced from Australian Electoral Commission",
x = "State", y = "Total Votes") +
scale_fill_brewer(palette = "Set3") +
scale_y_continuous(labels = scales::label_comma(), expand = expansion(mult = c(0, 0.1))) +
theme_minimal(base_size = 18) +
theme(plot.title = element_text(face = "bold"),
plot.subtitle = element_text(size = 14, margin = margin(b = 15)),
axis.title = element_text(face = "bold"))vote_types <- data %>%
select(StateNm, PostalVotes, PrePollVotes, AbsentVotes, OrdinaryVotes) %>%
pivot_longer(cols = -StateNm, names_to = "VoteType", values_to = "Count")
# Create ggplot
p <- ggplot(vote_types, aes(x = reorder(StateNm, Count), y = Count, fill = VoteType)) +
geom_col(position = "stack") + coord_flip() +labs(title = "Vote Types by State and Territory",subtitle = "Comparing Postal, PrePoll, Absent, and Ordinary Votes",x = "State", y = "Number of Votes", fill = "Vote Type" ) +scale_fill_brewer(palette = "Pastel1") + scale_y_continuous(labels = label_comma()) + theme_minimal(base_size = 16) + theme(plot.title = element_text(face = "bold"),plot.subtitle = element_text(size = 10, margin = margin(b = 13)),axis.title = element_text(face = "bold") )
# Make it interactive
ggplotly(p)NSW and VIC had the highest total votes.
Pre-poll and postal votes were widely used.
Insights support planning future election logistics.
Leverage data to enhance election infrastructure.
Allocate resources based on voting behaviour.
Promote transparency and voter engagement.
Australian Electoral Commission. (2025). House votes counted by state – Federal Election 2025. Retrieved from https://www.aec.gov.au/results/
Brewer, C. A. (2023). ColorBrewer 2.0: Color advice for cartography. Retrieved from https://colorbrewer2.org
Healy, K. (2018). Data visualization: A practical introduction. Princeton University Press. Retrieved from https://socviz.co
R Core Team. (2024). R: A language and environment for statistical computing (Version 4.4.0) [Computer software]. R Foundation for Statistical Computing. Retrieved from https://www.r-project.org/
RStudio, PBC. (2025). RStudio IDE user guide. Retrieved from https://posit.co
Sievert, C. (2020). Interactive web-based data visualization with R, plotly, and shiny. Chapman and Hall/CRC. Retrieved from https://plotly-r.com
Tennekes, M. (2018). tmap: Thematic maps in R. Journal of Statistical Software, 84(6), 1–39. https://doi.org/10.18637/jss.v084.i06
Wickham, H. (2016). ggplot2: Elegant graphics for data analysis. Springer-Verlag. Retrieved from https://ggplot2.tidyverse.org
Wickham, H., & Grolemund, G. (2016). R for data science: Import, tidy, transform, visualize, and model data. O’Reilly Media. Retrieved from https://r4ds.hadley.nz