Skip to content

Commit

Permalink
new ofsted data
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-pickering committed Oct 23, 2024
1 parent c479514 commit 564a8ad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 366 deletions.
15 changes: 13 additions & 2 deletions R/read_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,15 @@ read_spending_data2 <- function(file = "data/RO3_2023-24_data_by_LA.ods") {
}

# Ofsted leadership data
read_ofsted_leadership_data <- function(file = "data/Childrens_social_care_in_England_2023_underlying_data.ods") {
# read_ofsted_leadership_data <- function(file = "data/Childrens_social_care_in_England_2023_underlying_data.ods") {
read_ofsted_leadership_data <- function(file = "data/LA_Inspection_Outcomes_as_at_March_2024.ods") {
# Import data and drop top 3 rows to ensure headers are correct
ofsted_leadership_data <- read_ods(file, sheet = "LA_level_at_31_Mar_2023", skip = 3)
# ofsted_leadership_data <- read_ods(file, sheet = "LA_level_at_31_Mar_2023", skip = 3)
ofsted_leadership_data <- read_ods(file, sheet = "Inspections_31_March_2024", skip = 2)

# Remove authorities that aren't yet inspected
ofsted_leadership_data <- ofsted_leadership_data %>%
filter(`Inspection date` != "Not yet inspected")

# Convert "Inspection date" column to date format and copy the year into new "time_period" column
ofsted_leadership_data$`Inspection date` <- as.Date(ofsted_leadership_data$`Inspection date`, format = "%d/%m/%Y")
Expand Down Expand Up @@ -740,6 +746,8 @@ read_ofsted_leadership_data <- function(file = "data/Childrens_social_care_in_En
outstanding_count = sum(outstanding_count)
)

max(ofsted_leadership_data$time_period)

region_counts$time_period <- max(ofsted_leadership_data$time_period)

region_counts$geographic_level <- "Regional"
Expand All @@ -756,6 +764,8 @@ read_ofsted_leadership_data <- function(file = "data/Childrens_social_care_in_En
outstanding_count = sum(outstanding_count)
)



# Combine the new data with the existing data
ofsted_leadership_data <- bind_rows(ofsted_leadership_data, region_counts, national_counts)

Expand All @@ -765,6 +775,7 @@ read_ofsted_leadership_data <- function(file = "data/Childrens_social_care_in_En
return(ofsted_leadership_data)
}


pivot_ofsted_data <- function() {
# Pivoted version
ofsted_leadership_data_long <- read_ofsted_leadership_data() %>%
Expand Down
Binary file added data/LA_Inspection_Outcomes_as_at_March_2024.ods
Binary file not shown.
Loading

0 comments on commit 564a8ad

Please sign in to comment.