---
title: "Victorian Schools Statistics"
author: "Pragya Verma"
output:
flexdashboard::flex_dashboard:
orientation: columns
social: menu
source_code: embed
code_folding: hide
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
chooseCRANmirror(graphics = FALSE, ind = 1)
library(ggplot2)
library(highcharter)
library(dplyr)
library(flexdashboard)
library(readxl)
library(tidyverse)
thm <-
hc_theme(
colors = c("#1a6ecc", "#434348", "#90ed7d"),
chart = list(
backgroundColor = "transparent",
style = list(fontFamily = "Source Sans Pro", fontSize = "14px")
),
title = list(
style = list(fontSize = "20px")
),
xAxis = list(
gridLineWidth = 1,
labels = list(style = list(fontSize = "12px")),
title = list(style = list(fontSize = "14px"))
),
yAxis = list(
labels = list(style = list(fontSize = "12px")),
title = list(style = list(fontSize = "14px"))
)
)
```
Main
=====================================
Row {.tabset data-width=400}
-----------------------------------------------------------------------
### SCHOOLS BY SECTOR
Victoria's Number of Schools by Sector
```{r echo=FALSE}
schools <- data.frame(
Sector = c("Government", "Catholic", "Independent", "Total"),
Number_of_Schools = c(1553, 497, 226, 2276)
) %>%
arrange(desc(Number_of_Schools)) %>%
filter(Sector != "Total") # Remove the "Total" row
schools <- schools %>%
mutate(Percentage = Number_of_Schools / sum(Number_of_Schools) * 100)
ggplot(schools, aes(x = reorder(Sector, -Number_of_Schools), y = Number_of_Schools)) +
geom_bar(stat = "identity", aes(fill = Sector), width = 0.5) +
geom_text(aes(label = paste0(round(Percentage, 1), "%")), vjust = -0.5, size = 3) + # Add percentage labels at the top of the bars
scale_fill_manual(values = c("Government" = "lightblue", "Catholic" = "lightgreen", "Independent" = "lightpink")) +
labs(title = "Number of Schools by Sector",
x = "Sector",
y = "Number of Schools") +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5),
axis.title.x = element_text(margin = margin(t = 10)), # Adjust the margin value as needed
legend.position = "bottom" # Move legend to the bottom
)
```
### SCHOOLS BY REGION
Victoria's Number of Schools by Region
```{r echo=FALSE}
regional_summary <- data.frame(
Region = c("North-Eastern Victoria", "North-Western Victoria", "South-Eastern Victoria", "South-Western Victoria"),
Number_of_Schools = c(555, 512, 592, 631),
Number_of_FTE_Enrolments = c(142750.4, 143827.6, 185557.4, 181841.1)
) %>%
arrange(desc(Number_of_Schools))
regional_summary$Percentage <- (regional_summary$Number_of_Schools / sum(regional_summary$Number_of_Schools)) * 100
regional_summary$Percentage[regional_summary$Region == "Total"] <- NA
ggplot(regional_summary, aes(x = reorder(Region, -Number_of_Schools), y = Number_of_Schools)) +
geom_bar(stat = "identity", aes(fill = Region), width = 0.5) +
geom_text(aes(label = ifelse(is.na(Percentage), "", paste0(round(Percentage, 1), "%"))), vjust = -0.5, size = 3) +
scale_fill_manual(values = c("North-Eastern Victoria" = "steelblue", "North-Western Victoria" = "steelblue", "South-Eastern Victoria" = "steelblue", "South-Western Victoria" = "steelblue", "Total" = "green")) +
labs(title = "Number of Schools by Region",
x = "Region",
y = "Number of Schools") +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5),
axis.title.x = element_text(margin = margin(t = 10)), # Adjust the margin value as needed
axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "none"# Tilt the x-axis labels for clear visibility
)
```
Row {.tabset data-width=400}
-----------------------------------------------------------------------
### ENROLMENTS BY TYPE
Number of students enrolled in Victoria in different schools
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(ggplot2)
library(dplyr)
library(tidyr)
library(scales)
enrolments <- data.frame(
Region = c("North-Eastern Victoria", "North-Eastern Victoria", "North-Eastern Victoria", "North-Eastern Victoria", "North-Eastern Victoria",
"North-Western Victoria", "North-Western Victoria", "North-Western Victoria", "North-Western Victoria", "North-Western Victoria",
"South-Eastern Victoria", "South-Eastern Victoria", "South-Eastern Victoria", "South-Eastern Victoria", "South-Eastern Victoria",
"South-Western Victoria", "South-Western Victoria", "South-Western Victoria", "South-Western Victoria", "South-Western Victoria"),
Enrolment_Type = c("Primary", "Pri/Sec", "Secondary", "Special", "Language",
"Primary", "Pri/Sec", "Secondary", "Special", "Language",
"Primary", "Pri/Sec", "Secondary", "Special", "Language",
"Primary", "Pri/Sec", "Secondary", "Special", "Language"),
Government = c(81713.9, 5264.6, 52941.2, 2515.7, 315,
76908, 16629.6, 46338.7, 3600.3, 351,
107186.2, 4724.7, 69211.5, 3674, 761,
87237.7, 33521.1, 56486.7, 4152.6, 443),
Catholic = c(19347.4, 3359, 21696.9, 79, 0,
25228, 5406, 18480.6, 71, 0,
24331, 4730, 21220.6, 19, 0,
37792.1, 0, 30688.2, 729, 0),
Independent = c(1252.2, 35847, 1913.8, 1603.2, 0,
654, 26152.9, 540, 99, 0,
864.4, 51300.7, 182, 726.6, 0,
1121, 41688, 700.5, 380.4, 0)
)
enrolments_long <- enrolments %>%
pivot_longer(cols = -c(Region, Enrolment_Type), names_to = "Sector", values_to = "Enrolments")
custom_colors <- c("Government" = "lightblue", "Catholic" = "lightgreen", "Independent" = "lightpink", "Non_Government" = "grey")
ggplot(enrolments_long, aes(x = Enrolment_Type, y = Enrolments, fill = Sector)) +
geom_bar(stat = "identity") +
facet_wrap(~ Region, scales = "free") +
scale_fill_manual(values = custom_colors) +
scale_y_continuous(labels = scales::comma) + # Use comma format for y-axis labels
labs(title = "Enrolments by Type, Sector, and Region",
x = "Enrolment Type",
y = "Number of Enrolments") +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5),
axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "bottom")
```
### ENROLMENTS BY GENDER
Number of students enrolled in Victoria by Gender
```{r echo=FALSE}
enrolments_gender <- data.frame(
Gender = c("Males", "Females", "Self-described", "Total"),
Total = c(340211.1, 312941.9, 823.5, 653976.5)
)
enrolments_gender <- enrolments_gender %>% filter(Gender != "Total")
ggplot(enrolments_gender, aes(x = "", y = Total, fill = Gender)) +
geom_bar(stat = "identity", width = 1) +
coord_polar(theta = "y") +
geom_text(aes(label = paste0(round(Total / sum(Total) * 100, 1), "%")),
position = position_stack(vjust = 0.5), size = 4) +
labs(title = "Enrolments by Gender") +
theme_void() +
theme(
plot.title = element_text(hjust = 0.5)
)
```
Row {.tabset data-width=400}
-----------------------------------------------------------------------
### FTE TEACHERS SUMMARY
Number of teachers in different schools of Victoria
```{r echo=FALSE}
teachers <- data.frame(
Type_of_School = c("Primary", "Secondary", "Special / P-12 / Language"),
Total = c(24563.7, 18237.9, 8075.4)
)
teachers_no_total <- teachers %>% filter(Type_of_School != "Total")
teachers_no_total$Percentage <- (teachers_no_total$Total / sum(teachers_no_total$Total)) * 100
teachers <- teachers %>%
left_join(teachers_no_total %>% select(Type_of_School, Percentage), by = "Type_of_School")
ggplot(teachers, aes(x = Type_of_School, y = Total, fill = Type_of_School)) +
geom_bar(stat = "identity") +
geom_text(data = teachers %>% filter(!is.na(Percentage)), aes(label = paste0(round(Percentage, 1), "%")), vjust = -0.5, size = 3) +
scale_fill_manual(values = c("Primary" = "antiquewhite3", "Secondary" = "coral", "Special / P-12 / Language" = "azure4")) +
labs(title = "Number of Teachers by Type of School",
x = "Type of School",
y = "Number of Teachers") +
theme_minimal() +
theme(
plot.title = element_text(hjust = 0.5),
axis.text.x = element_text(angle = 45, hjust = 1),
legend.position = "bottom" # Move legend to the bottom
)
```
References
=====================================
REFERENCES:
Victorian Government. (2023). Statistics: Victorian schools and teaching. Retrieved from https://www.vic.gov.au/statistics-victorian-schools-and-teaching
Baglin, J. (2023). Chapter 10. Dashboards.
Retrieved from https://dark-star-161610.appspot.com/secured/_book/dashboards.html#conclusion-1
Key Points
=====================================
KEY POINTS:
The dashboard explores important summaries of Victoria's schools.
1. Schools by Sector: Explore the number of schools across different sectors, including Government, Catholic, and Independent schools. This section highlights the distribution of schools within each sector and their relative proportions.
2. Schools by Region: Understand the geographical distribution of schools in Victoria. This section breaks down the number of schools by region, providing insights into regional disparities and concentrations.
3. Enrolments by Type: Analyze student enrolments across various school types and sectors. This section allows users to compare enrolment numbers in primary, secondary, special, and language schools within different regions.
4. Enrolments by Gender: Discover the gender distribution of student enrolments. This visualization helps in understanding the demographic makeup of the student population in Victorian schools.
5. FTE Teachers Summary: Examine the distribution of full-time equivalent (FTE) teachers across different types of schools. This section provides an overview of the teaching workforce in primary, secondary, and special schools.
Purpose:
The dashboard aims to provide educators, policymakers, and the public with accessible and insightful visualizations of the educational data in Victoria. It supports data-driven decision-making by presenting key statistics in an interactive and user-friendly format.