Skip to content
Snippets Groups Projects
Commit 3e766fcc authored by Tom Rushby's avatar Tom Rushby
Browse files

Set Hampshire as default area.

parent 2af5946a
Branches
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ total_hampshire_dt <- dt %>% ...@@ -78,7 +78,7 @@ total_hampshire_dt <- dt %>%
mutate(Population = Population*1000) %>% mutate(Population = Population*1000) %>%
group_by(Year) %>% group_by(Year) %>%
summarise_if(is.numeric, sum, na.rm = TRUE) %>% summarise_if(is.numeric, sum, na.rm = TRUE) %>%
mutate(Name = " Hampshire (Average)", mutate(Name = " Hampshire",
`CTRY18NM/RGN18NM` = "South East", `CTRY18NM/RGN18NM` = "South East",
`Second Tier Authority` = "Hampshire", `Second Tier Authority` = "Hampshire",
Code = "E00000000") %>% Code = "E00000000") %>%
...@@ -115,7 +115,7 @@ pc_totals_plot <- melt(pc_totals_plot, id.vars = c("CTRY18NM.RGN18NM","Second.Ti ...@@ -115,7 +115,7 @@ pc_totals_plot <- melt(pc_totals_plot, id.vars = c("CTRY18NM.RGN18NM","Second.Ti
# Functions ---- # Functions ----
ghg_subset <- function(dt, auth_area = "Southampton"){ ghg_subset <- function(dt, auth_area = " Hampshire"){
dt <- dt %>% dt <- dt %>%
filter(dt$Name %in% auth_area) filter(dt$Name %in% auth_area)
# add filter for categories with input$ # add filter for categories with input$
...@@ -123,7 +123,7 @@ ghg_subset <- function(dt, auth_area = "Southampton"){ ...@@ -123,7 +123,7 @@ ghg_subset <- function(dt, auth_area = "Southampton"){
ghg_subset2 <- function(dt, auth_area = "Southampton", plot_year = 2018){ ghg_subset2 <- function(dt, auth_area = " Hampshire", plot_year = 2018){
dt <- dt %>% dt <- dt %>%
filter(dt$Name %in% auth_area, filter(dt$Name %in% auth_area,
dt$Year == plot_year) dt$Year == plot_year)
...@@ -227,7 +227,7 @@ server <- function(input, output, session) { ...@@ -227,7 +227,7 @@ server <- function(input, output, session) {
"\nVisualisation: rushby.shinyapps.io/LAemissions") "\nVisualisation: rushby.shinyapps.io/LAemissions")
if(is.null(input$authmap_shape_click$id)){ if(is.null(input$authmap_shape_click$id)){
auth_area <- "Southampton" auth_area <- " Hampshire"
} else { } else {
auth_area <- input$authmap_shape_click$id auth_area <- input$authmap_shape_click$id
} }
...@@ -256,7 +256,7 @@ server <- function(input, output, session) { ...@@ -256,7 +256,7 @@ server <- function(input, output, session) {
output$bar <- renderPlot({ output$bar <- renderPlot({
if(is.null(input$authmap_shape_click$id)){ if(is.null(input$authmap_shape_click$id)){
auth_area <- "Southampton" auth_area <- " Hampshire"
} else { } else {
auth_area <- input$authmap_shape_click$id auth_area <- input$authmap_shape_click$id
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment