diff --git a/R/read_data.R b/R/read_data.R index c3cee32..60ca2d4 100644 --- a/R/read_data.R +++ b/R/read_data.R @@ -637,8 +637,10 @@ read_cin_referral_data <- function(file = "data/c1_children_in_need_referrals_an read_outcome2 <- function(file = "data/la_children_who_ceased_during_the_year.csv") { read_data <- read.csv(file) # Call remove old la data function to remove the old - final_filtered_data <- remove_old_la_data(read_data) + # final_filtered_data <- remove_old_la_data(read_data) + las_to_remove <- c("Poole", "Bournemouth", "Northamptonshire") + final_filtered_data <- read_data %>% filter(new_la_code != "E10000009", !la_name %in% las_to_remove) ceased_cla_data <- final_filtered_data %>% mutate(geo_breakdown = case_when( geographic_level == "National" ~ "National", # NA_character_, diff --git a/server.R b/server.R index f8693c1..2f8446f 100644 --- a/server.R +++ b/server.R @@ -1866,7 +1866,7 @@ server <- function(input, output, session) { observeEvent(eventExpr = { input$select_geography_o2 }, { - choices <- sort(unique(ceased_cla_data[ceased_cla_data$geographic_level == input$select_geography_o2, "geo_breakdown"]), decreasing = FALSE) + choices <- sort(unique(ceased_cla_data[(ceased_cla_data$geographic_level == input$select_geography_o2 & ceased_cla_data$time_period == max(ceased_cla_data$time_period)), "geo_breakdown"]), decreasing = FALSE) updateSelectizeInput( session = session,