---
title: "Data Processing Scripts"
author: "Adam Dennett"
---
## Processed Allocation Factsheets 2013-2025
## 2025
```{r echo=F, message=F, warning=F}
# Load necessary libraries
library(dplyr)
library(tidyr)
library(knitr)
library(DT)
# Create the data frame for Year 7 admissions 2025
yr_7_admissions_2025 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill High", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_pref = c("258 (244)", "83 (83)", "523 (349)", "215 (186)", "130 (130)", "252 (170)",
"74 (74)", "166 (166)", "175 (175)", "427 (284)", "2303 (1861)"),
No_2nd_pref = c("273 (61)", "37 (5)", "239 (11)", "479 (127)", "242 (27)", "280 (10)",
"39 (17)", "74 (18)", "87 (12)", "390 (13)", "2140 (301)"),
No_3rd_pref = c("303 (25)", "33 (1)", "319 (0)", "228 (17)", "274 (14)", "219 (0)",
"36 (1)", "235 (18)", "70 (3)", "192 (3)", "1911 (87)"),
Total = c("834 (330)", "153 (89)", "1081 (360)", "922 (330)", "646 (171)", "751 (180)",
"151 (97)", "475 (202)", "332 (190)", "1009 (300)", "6354 (2249)")
)
# Separate numbers and actual values in brackets into their own columns
yr_7_admissions_2025 <- yr_7_admissions_2025 %>%
separate(No_1st_pref, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_pref, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_pref, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2025 <- yr_7_admissions_2025 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2025, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
<https://www.brighton-hove.gov.uk/children-and-learning/allocation-factsheet-year-7-places-september-2025>
## 2024
<https://www.brighton-hove.gov.uk/allocation-factsheet-year-7-places-september-2024>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame
yr_7_admissions_2024 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill High", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_pref = c("279 (243)", "73 (73)", "466 (347)", "234 (199)", "110 (110)", "242 (159)",
"80 (80)", "210 (182)", "129 (129)", "456 (293)", "2279 (1815)"),
No_2nd_pref = c("268 (69)", "27 (6)", "203 (12)", "518 (111)", "252 (41)", "224 (6)",
"30 (9)", "89 (23)", "105 (38)", "394 (7)", "2110 (322)"),
No_3rd_pref = c("224 (18)", "39 (5)", "272 (1)", "262 (20)", "244 (19)", "202 (0)",
"39 (5)", "253 (20)", "77 (4)", "209 (0)", "1821 (92)"),
Total = c("771 (330)", "139 (84)", "941 (360)", "1014 (330)", "606 (170)", "668 (165)",
"149 (94)", "552 (225)", "311 (171)", "1059 (300)", "6210 (2259)")
)
# Separate numbers and actual values in brackets into their own columns
yr_7_admissions_2024 <- yr_7_admissions_2024 %>%
separate(No_1st_pref, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_pref, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_pref, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2024 <- yr_7_admissions_2024 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2024, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
Any child living within Brighton & Hove who was not offered a place at one of their preferred schools would have been offered a place at the nearest school with places available.
## 2023
<https://www.brighton-hove.gov.uk/children-and-learning/allocation-factsheet-year-7-places-september-2023>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame
yr_7_admissions_2023 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_pref = c("300 (260)", "92 (92)", "451 (351)", "260 (242)", "158 (132)", "241 (162)",
"134 (134)", "203 (196)", "154 (154)", "409 (292)", "2402 (2015)"),
No_2nd_pref = c("309 (61)", "34 (5)", "189 (9)", "516 (81)", "298 (40)", "229 (3)",
"38 (14)", "87 (17)", "79 (26)", "423 (8)", "2202 (264)"),
No_3rd_pref = c("231 (9)", "34 (3)", "297 (0)", "232 (7)", "258 (8)", "198 (0)",
"27 (4)", "292 (12)", "113 (20)", "233 (0)", "1915 (63)"),
Total = c("840 (330)", "160 (100)", "937 (360)", "1008 (330)", "714 (180)", "668 (165)",
"199 (152)", "582 (225)", "346 (200)", "1065 (300)", "6789 (2407)")
)
# Separate numbers and actual values in brackets into their own columns
yr_7_admissions_2023 <- yr_7_admissions_2023 %>%
separate(No_1st_pref, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_pref, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_pref, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2023 <- yr_7_admissions_2023 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2023, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
Any child living within Brighton & Hove who was not offered a place at one of their preferred schools would have been offered a place at the nearest school with places available.
## 2022
<https://www.brighton-hove.gov.uk/schools-and-learning/apply-school/allocation-factsheet-year-7-places-september-2022>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame
yr_7_admissions_2022 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_pref = c("292 (270)", "121 (121)", "381 (342)", "291 (258)", "115 (115)", "232 (160)",
"104 (104)", "218 (197)", "166 (166)", "444 (303)", "2364 (2034)"),
No_2nd_pref = c("299 (50)", "37 (8)", "182 (16)", "537 (87)", "246 (24)", "234 (3)",
"39 (10)", "80 (12)", "106 (26)", "435 (6)", "2195 (245)"),
No_3rd_pref = c("235 (10)", "77 (3)", "293 (2)", "226 (4)", "235 (10)", "203 (2)",
"45 (8)", "320 (16)", "84 (2)", "212 (1)", "1930 (57)"),
Total = c("826 (330)", "235 (132)", "856 (360)", "1054 (349)", "596 (149)", "669 (165)",
"188 (122)", "618 (225)", "356 (194)", "1091 (310)", "6789 (2407)")
)
# Separate numbers and actual values in brackets into their own columns
yr_7_admissions_2022 <- yr_7_admissions_2022 %>%
separate(No_1st_pref, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_pref, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_pref, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2022 <- yr_7_admissions_2022 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2022, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
There were 29 children in the Dorothy Stringer/Varndean Catchment area who applied for both these schools but could not initially be offered a catchment area school or a higher preference. To accommodate these children in a catchment area school, 19 additional children were allocated to Dorothy Stringer and 10 to Varndean school.
All children living in the Dorothy Stringer/Varndean catchment who expressed a preference for both catchment schools were offered a place at a catchment school or a higher preference.
The Published Admissions Number (PAN) for Dorothy Stringer and Varndean school will remain at 330 and 300 respectively.
## 2021
<https://www.brighton-hove.gov.uk/schools-and-learning/apply-school/allocation-factsheet-year-7-places-september-2021>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame
yr_7_admissions_2021 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_pref = c("400 (284)", "116 (116)", "414 (340)", "386 (306)", "116 (116)", "235 (150)",
"145 (145)", "211 (193)", "165 (165)", "386 (296)", "2574 (2111)"),
No_2nd_pref = c("320 (40)", "46 (9)", "226 (18)", "493 (23)", "310 (101)", "258 (14)",
"35 (12)", "83 (15)", "90 (16)", "492 (4)", "2353 (252)"),
No_3rd_pref = c("278 (6)", "49 (16)", "321 (2)", "227 (1)", "249 (30)", "280 (1)",
"46 (10)", "252 (17)", "102 (5)", "208 (0)", "2012 (88)"),
Total = c("998 (330)", "211 (141)", "961 (360)", "1106 (330)", "675 (247)", "773 (165)",
"226 (167)", "546 (225)", "357 (186)", "1086 (300)", "6939 (2501)")
)
# Separate numbers and actual values in brackets into their own columns
yr_7_admissions_2021 <- yr_7_admissions_2021 %>%
separate(No_1st_pref, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_pref, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_pref, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2021 <- yr_7_admissions_2021 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2021, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
There were 62 children in the Dorothy Stringer/Varndean Catchment area who couldn’t be offered a catchment area school or a higher preference. Of these 62 children, 44 expressed preferences for both catchment area schools.
## 2020
<https://www.brighton-hove.gov.uk/schools-and-learning/apply-school/allocation-factsheet-year-7-places-september-2020>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2020
yr_7_admissions_2020 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("350 (279)", "89 (89)", "349 (311)", "438 (357)", "80 (80)", "253 (145)",
"159 (159)", "219 (206)", "174 (174)", "307 (268)", "2418 (2068)"),
No_2nd_preferences = c("281 (45)", "50 (7)", "221 (39)", "489 (7)", "227 (33)", "282 (5)",
"38 (11)", "65 (11)", "95 (21)", "530 (36)", "2278 (215)"),
No_3rd_preferences = c("237 (6)", "62 (10)", "326 (10)", "203 (0)", "281 (24)", "257 (0)",
"38 (7)", "304 (8)", "77 (8)", "231 (0)", "2016 (73)"),
Total = c("868 (330)", "201 (106)", "896 (360)", "1130 (364)", "588 (137)", "792 (150)",
"235 (177)", "588 (225)", "346 (203)", "1068 (304)", "")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2020 <- yr_7_admissions_2020 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2020 <- yr_7_admissions_2020 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2020, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
There were 8 children in the Dorothy Stringer and Varndean Catchment area who applied for both these schools but could not initially be offered a catchment area school or a higher preference. In order to accommodate these children in a catchment area school, 4 additional children were allocated, each, to Dorothy Stringer and Varndean schools.
## 2019
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20factsheet%202019.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2019
yr_7_admissions_2019 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("373 (282)", "92 (92)", "465 (340)", "447 (355)", "119 (119)", "188 (157)",
"153 (152)", "217 (190)", "168 (164)", "304 (251)", "2526 (2102)"),
No_2nd_preferences = c("344 (37)", "40 (11)", "219 (14)", "470 (9)", "289 (62)", "209 (17)",
"33 (16)", "83 (19)", "106 (49)", "537 (47)", "2330 (281)"),
No_3rd_preferences = c("256 (11)", "49 (7)", "344 (6)", "233 (0)", "271 (34)", "204 (4)",
"62 (15)", "299 (16)", "136 (27)", "257 (6)", "2111 (126)"),
Total = c("973 (330)", "181 (110)", "1028 (360)", "1150 (364)", "679 (215)", "601 (178)",
"248 (183)", "599 (225)", "410 (240)", "1098 (304)", "6967 (2509)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2019 <- yr_7_admissions_2019 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2019 <- yr_7_admissions_2019 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2019, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
- There were 8 children in the Dorothy Stringer/Varndean Catchment area who applied for both these schools but could not initially be offered a catchment area school or a higher preference. In order to accommodate these children in a catchment area school, 4 additional children were allocated, each, to Dorothy Stringer and Varndean schools.
## 2018
<https://www.brighton-hove.gov.uk/sites/default/files/migrated/subject/inline/Secondary%20Allocation%20factsheet%202018.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2018
yr_7_admissions_2018 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("401 (303)", "110 (109)", "381 (342)", "413 (325)", "151 (151)", "143 (117)",
"156 (156)", "226 (191)", "168 (168)", "355 (280)", "2504 (2142)"),
No_2nd_preferences = c("288 (22)", "42 (15)", "162 (15)", "488 (6)", "345 (71)", "133 (7)",
"28 (8)", "64 (13)", "108 (13)", "486 (20)", "2143 (190)"),
No_3rd_preferences = c("257 (5)", "50 (6)", "274 (3)", "208 (0)", "226 (17)", "159 (1)",
"47 (11)", "368 (21)", "133 (7)", "253 (0)", "1975 (71)"),
Total = c("946 (330)", "202 (130)", "816 (360)", "1109 (331)", "722 (239)", "435 (125)",
"231 (175)", "658 (225)", "409 (188)", "1094 (300)", "6622 (2403)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2018 <- yr_7_admissions_2018 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2018 <- yr_7_admissions_2018 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2018, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
- Please note that 1 additional child was allocated a place at Dorothy Stringer School in order that twins could be kept together at the same school.
## 2017
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20factsheet%202017.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2017
yr_7_admissions_2017 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("336 (282)", "90 (90)", "362 (330)", "459 (327)", "198 (198)", "124 (94)",
"131 (131)", "211 (185)", "158 (158)", "304 (228)", "2373 (2023)"),
No_2nd_preferences = c("323 (14)", "22 (9)", "154 (20)", "455 (3)", "299 (45)", "123 (4)",
"33 (8)", "90 (12)", "65 (13)", "482 (35)", "2046 (163)"),
No_3rd_preferences = c("238 (4)", "31 (9)", "278 (10)", "159 (1)", "229 (12)", "142 (2)",
"39 (11)", "303 (18)", "84 (5)", "244 (7)", "1747 (79)"),
Total = c("897 (300)", "143 (108)", "794 (360)", "1073 (331)", "726 (255)", "389 (100)",
"203 (150)", "604 (215)", "307 (176)", "1030 (270)", "6167 (2282)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2017 <- yr_7_admissions_2017 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2017 <- yr_7_admissions_2017 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2017, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
## 2016
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20Factsheet%202016.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2016
yr_7_admissions_2016 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("410 (292)", "87 (87)", "375 (338)", "495 (337)", "172 (172)", "98 (90)",
"138 (138)", "217 (185)", "85 (85)", "219 (176)", "2296 (1900)"),
No_2nd_preferences = c("289 (6)", "24 (7)", "130 (17)", "337 (7)", "335 (82)", "102 (9)",
"31 (14)", "63 (20)", "39 (8)", "521 (100)", "1871 (270)"),
No_3rd_preferences = c("189 (2)", "27 (5)", "330 (5)", "191 (0)", "224 (19)", "142 (1)",
"33 (11)", "237 (10)", "58 (1)", "217 (8)", "1648 (62)"),
Total = c("888 (300)", "138 (99)", "835 (360)", "1023 (344)", "731 (273)", "342 (100)",
"202 (163)", "517 (215)", "182 (94)", "957 (284)", "5815 (2232)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2016 <- yr_7_admissions_2016 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2016 <- yr_7_admissions_2016 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2016, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
## 2015
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20factsheet%202015.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2015
yr_7_admissions_2015 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("389 (287)", "120 (120)", "385 (345)", "471 (329)", "215 (200)", "90 (90)",
"141 (141)", "208 (184)", "86 (86)", "210 (176)", "2315 (1958)"),
No_2nd_preferences = c("323 (13)", "17 (4)", "132 (13)", "366 (4)", "387 (77)", "71 (17)",
"34 (9)", "72 (13)", "35 (24)", "480 (94)", "1917 (268)"),
No_3rd_preferences = c("234 (1)", "39 (6)", "306 (2)", "189 (4)", "220 (22)", "108 (14)",
"33 (6)", "250 (13)", "70 (13)", "233 (7)", "1682 (88)"),
Total = c("946 (301)", "176 (130)", "823 (360)", "1026 (337)", "823 (299)", "269 (121)",
"208 (156)", "530 (210)", "191 (123)", "923 (277)", "5915 (2214)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2015 <- yr_7_admissions_2015 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2015 <- yr_7_admissions_2015 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2015, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
\*\*\* There were 14 children in the Dorothy Stringer/Varndean Catchment area who applied for both these schools but could not initially be offered a catchment area school or a higher preference. In order to accommodate these children in a catchment area school, 7 additional children were allocated each to Dorothy Stringer and Varndean schools.
## 2014
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20factsheet%202014.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2014
yr_7_admissions_2014 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Kings School", "Longhill", "Patcham High", "Portslade Aldridge Community Academy",
"Varndean", "Total"),
No_1st_preferences = c("349 (286)", "68 (68)", "393 (355)", "493 (316)", "181 (181)", "105 (105)", "191 (191)" ,"209 (179)", "85 (85)", "216 (165)", "2290 (1931)"),
No_2nd_preferences = c("287 (11)", "18 (5)", "135 (3)", "414 (15)", "343 (58)", "54 (7)", "38 (12)" ,"67 (11)", "38 (6)", "495 (95)", "1889 (223)"),
No_3rd_preferences = c("212 (3)", "27 (9)", "296 (2)", "178 (0)", "195 (21)", "77 (3)", "32 (6)" ,"222 (20)", "39 (1)", "254 (10)", "1532 (75)"),
Total = c("848 (300)", "113 (82)", "824 (360)", "1085 (331)", "719 (260)", "236 (115)", "261 (209)" ,"498 (210)", "162 (92)", "965 (270)", "6654 (1975)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2014 <- yr_7_admissions_2014 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2014 <- yr_7_admissions_2014 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2014, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
There were 23 children In catchment area who couldn’t be offered Varndean School or a higher preference.
## 2013
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/Secondary%20Allocation%20factsheet%202013.pdf>
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
library(knitr)
# Create the original data frame for 2013
yr_7_admissions_2013 <- data.frame(
School = c("Blatchington Mill", "Brighton Aldridge Community Academy", "Cardinal Newman", "Dorothy Stringer",
"Hove Park", "Longhill", "Patcham High", "Portslade Aldridge Community Academy", "Varndean", "Total"),
No_1st_preferences = c("400 (285)", "79 (79)", "409 (354)", "507 (326)", "175 (175)", "188 (188)",
"186 (180)", "80 (80)", "169 (142)", "2193 (1809)"),
No_2nd_preferences = c("333 (14)", "17 (3)", "129 (5)", "370 (4)", "333 (95)", "26 (8)",
"65 (17)", "30 (9)", "485 (110)", "1788 (265)"),
No_3rd_preferences = c("228 (1)", "19 (1)", "300 (1)", "182 (0)", "234 (29)", "43 (4)",
"198 (13)", "62 (2)", "253 (18)", "1519 (69)"),
Total = c("961 (300)", "115 (83)", "838 (360)", "1059 (330)", "742 (299)", "257 (200)",
"449 (210)", "172 (91)", "907 (270)", "5500 (2143)")
)
# Separate numbers and actual values in brackets into their own columns with new names
yr_7_admissions_2013 <- yr_7_admissions_2013 %>%
separate(No_1st_preferences, into = c("No_1st_pref", "No_1st_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_2nd_preferences, into = c("No_2nd_pref", "No_2nd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(No_3rd_preferences, into = c("No_3rd_pref", "No_3rd_pref_offer"), sep = " \\(", convert = TRUE) %>%
separate(Total, into = c("Total", "Total_offer"), sep = " \\(", convert = TRUE)
# Remove closing parenthesis from actual values
yr_7_admissions_2013 <- yr_7_admissions_2013 %>%
mutate(
No_1st_pref_offer = as.numeric(gsub("\\)", "", No_1st_pref_offer)),
No_2nd_pref_offer = as.numeric(gsub("\\)", "", No_2nd_pref_offer)),
No_3rd_pref_offer = as.numeric(gsub("\\)", "", No_3rd_pref_offer)),
Total_offer = as.numeric(gsub("\\)", "", Total_offer))
)
# Create DT table
datatable(yr_7_admissions_2013, extensions = 'Buttons', options = list(
pageLength = 11,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
## Data Prior to 2013
Prior to 2013, data availability is patchy - nothing for 2012, 2009 or 2007, sadly. Links to data I could find, below, but I've not digitised it yet.
2012
2011
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/downloads/education/3740_school_booklets_secondary_AW_final.pdf>
2010
<https://ww3.brighton-hove.gov.uk/sites/brighton-hove.gov.uk/files/downloads/education/Secondary_School_Admissions_2011-12.pdf>
2009
2008
<https://democracy.brighton-hove.gov.uk/documents/s2224/Item%2048-Appendix1.pdf>
2007
<https://democracy.brighton-hove.gov.uk/documents/s2224/Item%2048-Appendix1.pdf>
## Combined Data for All Years
```{r, echo=F, message=F, warning=F}
library(dplyr)
library(tidyr)
# List of data frames
data_frames <- list(yr_7_admissions_2013, yr_7_admissions_2014, yr_7_admissions_2015, yr_7_admissions_2016, yr_7_admissions_2017,
yr_7_admissions_2018, yr_7_admissions_2019, yr_7_admissions_2020, yr_7_admissions_2021,
yr_7_admissions_2022, yr_7_admissions_2023, yr_7_admissions_2024, yr_7_admissions_2025)
# Assign years to each data frame
years <- 2013:2025
# Combine data frames with a year column
combined_data <- bind_rows(lapply(seq_along(data_frames), function(i) {
mutate(data_frames[[i]], Year = years[i])
}))
# Reshape to long format
combined_data_long <- combined_data %>%
select(School, Year, No_1st_pref, No_1st_pref_offer, No_2nd_pref, No_2nd_pref_offer,
No_3rd_pref, No_3rd_pref_offer, Total, Total_offer)
# Arrange the data
combined_data_long <- combined_data_long %>%
arrange(Year, School)
# View the combined long format data
#print(combined_data_long)
# Update school names to ensure consistency
combined_data_long <- combined_data_long %>%
mutate(School = ifelse(School == "Longhill", "Longhill High", School))
# Verify the changes
#unique(combined_data_long$School)
datatable(combined_data_long, extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
)
```
## Time Series Applications and Offers - All Schools
### Applications
```{r, echo=F, message=F, warning=F}
library(ggplot2)
# Filter out the "Total" from the combined data
combined_data_long_filtered <- combined_data_long %>%
filter(School != "Total")
# Create the plot
ggplot(combined_data_long_filtered, aes(x = Year, y = Total, color = School, group = School)) +
geom_line() +
geom_point() +
xlab("Year") +
ylab("Total Applications") +
theme_minimal() +
ggtitle("Yearly Total Applications by School") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
### Offers
```{r, echo=F, message=F, warning=F}
library(ggplot2)
# Filter out the "Total" from the combined data
combined_data_long_filtered <- combined_data_long %>%
filter(School != "Total")
# Create the plot
ggplot(combined_data_long_filtered, aes(x = Year, y = Total_offer, color = School, group = School)) +
geom_line() +
geom_point() +
xlab("Year") +
ylab("Total Offers") +
theme_minimal() +
ggtitle("Yearly Total Offers by School") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
## Small Schools
```{r, echo=F, message=F, warning=F}
# Filter data for the specified schools
selected_schools <- combined_data_long %>%
filter(School %in% c("Longhill High", "Kings School", "Brighton Aldridge Community Academy"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total_offer, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Offers") +
theme_minimal() +
ggtitle("Yearly Total Offers") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
scale_y_continuous(limits = c(70, 290), breaks = seq(0, 280, by = 20)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
) +
geom_hline(yintercept = 270, color = "blue", linetype = "solid") +
annotate("text", x = max(combined_data_long_filtered$Year) - 1, y = 270, label = "Longhill PAN", color = "blue", vjust = -1)
```
```{r, echo=F, message=F, warning=F}
# Filter data for the specified schools
selected_schools <- combined_data_long %>%
filter(School %in% c("Longhill High", "Kings School", "Brighton Aldridge Community Academy"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Applications") +
theme_minimal() +
ggtitle("Yearly Total Applications") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
scale_y_continuous(limits = c(100, 800), breaks = seq(100, 800, by = 100)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
) +
geom_hline(yintercept = 270, color = "blue", linetype = "solid") +
annotate("text", x = max(combined_data_long_filtered$Year) - 1, y = 270, label = "Longhill PAN", color = "blue", vjust = -1)
```
## Similar Sized Schools
```{r, echo=F, message=F, warning=F}
# Filter data for the specified schools
selected_schools <- combined_data_long %>%
filter(School %in% c("Varndean", "Dorothy Stringer", "Hove Park", "Blatchington Mill", "Patcham High"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Applications") +
theme_minimal() +
ggtitle("Yearly Total Applications") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
```{r, echo=F, message=F, warning=F}
# Filter data for the specified schools
selected_schools <- combined_data_long %>%
filter(School %in% c("Varndean", "Dorothy Stringer", "Hove Park", "Blatchington Mill"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total_offer, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Offers") +
theme_minimal() +
ggtitle("Yearly Total Offers") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
## Hove Schools Preferences and Offers
```{r, echo=F, message=F, warning=F}
selected_schools <- combined_data_long %>%
filter(School %in% c("Kings School", "Cardinal Newman", "Hove Park", "Blatchington Mill", "Portslade Aldridge Community Academy"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Applications") +
theme_minimal() +
ggtitle("Yearly Total Applications") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
```{r, echo=F, message=F, warning=F}
# Filter data for the specified schools
selected_schools <- combined_data_long %>%
filter(School %in% c("Kings School", "Cardinal Newman", "Hove Park", "Blatchington Mill", "Portslade Aldridge Community Academy"))
# Create the plot
ggplot(selected_schools, aes(x = Year, y = Total_offer, color = School, group = School)) +
geom_line() +
geom_point() +
geom_smooth(method = "lm", se = FALSE, linetype = "dotted") +
xlab("Year") +
ylab("Total Offers") +
theme_minimal() +
ggtitle("Yearly Total Offers") +
scale_x_continuous(breaks = seq(min(combined_data_long_filtered$Year), max(combined_data_long_filtered$Year), by = 1)) +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid.major.x = element_line(color = "grey", linetype = "dashed"),
panel.grid.minor.x = element_blank()
)
```
## Preferences Varying y-Axis
```{r, echo=F, message=F, warning=F}
# Load necessary libraries
library(ggplot2)
library(dplyr)
library(tidyr)
# Assuming your data frame is named combined_data_long_filtered and is already loaded
# Reshape the data frame for ggplot
combined_data_long_filtered <- combined_data_long_filtered %>%
pivot_longer(cols = c(No_1st_pref, No_2nd_pref, No_3rd_pref),
names_to = "Preference",
values_to = "Count")
combined_data_long_filtered <- combined_data_long_filtered %>%
mutate(School = case_when(
School == "Brighton Aldridge Community Academy" ~ "BACA",
School == "Portslade Aldridge Community Academy" ~ "PACA",
TRUE ~ School
))
# Create the faceted line plot
ggplot(combined_data_long_filtered, aes(x = Year, y = Count, color = Preference)) +
geom_line() +
facet_wrap(~ School, scales = "free_y") +
scale_x_continuous(breaks = seq(2013, 2025, 1)) +
labs(title = "Preference Count Over Years by School",
x = "Year",
y = "Count",
color = "Preference") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 0.5))
```
## Preferences Fixed y-Axis
```{r, echo=F, message=F, warning=F}
library(wesanderson)
# Define a color palette
#color_palette <- c("No_1st_pref" = "skyblue", "No_2nd_pref" = "dodgerblue", "No_3rd_pref" = "blue")
color_palette <- wes_palette("BottleRocket2", n = 3)
# Create the faceted line plot with fixed y-axis and custom colors
ggplot(combined_data_long_filtered, aes(x = Year, y = Count, color = Preference)) +
geom_line() +
facet_wrap(~ School, scales = "fixed") +
scale_color_manual(values = color_palette) +
scale_x_continuous(breaks = seq(2013, 2025, 1)) +
labs(title = "Preference Count Over Years by School",
x = "Year",
y = "Count",
color = "Preference") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 0.5))
```
## Offers Fixed y-Axis
```{r}
library (wesanderson)
combined_data_long_filtered <- combined_data_long %>%
filter (School != "Total" )# Define a color palette
combined_data_long_filtered <- combined_data_long_filtered %>%
pivot_longer (cols = c (No_1st_pref_offer, No_2nd_pref_offer, No_3rd_pref_offer),
names_to = "Preference" ,
values_to = "Count" )
combined_data_long_filtered <- combined_data_long_filtered %>%
mutate (School = case_when (
School == "Brighton Aldridge Community Academy" ~ "BACA" ,
School == "Portslade Aldridge Community Academy" ~ "PACA" ,
TRUE ~ School
))
#color_palette <- c("No_1st_pref" = "skyblue", "No_2nd_pref" = "dodgerblue", "No_3rd_pref" = "blue")
color_palette <- wes_palette ("Darjeeling1" , n = 3 )
# Create the faceted line plot with fixed y-axis and custom colors
ggplot (combined_data_long_filtered, aes (x = Year, y = Count, color = Preference)) +
geom_line () +
facet_wrap (~ School, scales = "fixed" ) +
scale_color_manual (values = color_palette) +
scale_x_continuous (breaks = seq (2013 , 2025 , 1 )) +
labs (title = "Offer Count by Preference Over Years by School" ,
x = "Year" ,
y = "Count" ,
color = "Preference" ) +
theme_minimal () +
theme (axis.text.x = element_text (angle = 90 , vjust = 0.5 , hjust = 0.5 ))
```