library(readxl)
library(readxl)
d <- read_excel("Electorates.xlsx",
sheet = "Raw data", col_types = c("text",
"text", "text", "numeric", "numeric",
"numeric", "numeric", "text", "text",
"numeric", "numeric", "numeric"))
library(aqm)
##
## Attaching package: 'aqm'
## The following object is masked from 'package:stats':
##
## dt
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
dt(d)
d %>% filter(type=="December") %>% group_by(ConstituencyName) %>% summarise(range=max(PC_Electors)-min(PC_Electors)) %>% dt()
shiny::selectizeInput("Constituency","Constituency",choices=levels(d$ConstituencyName), selected="Bournemouth West")