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
library(ggplot2)
library(tidyr)

data(ge_historical)

d %>% group_by(election) %>% summarise(cons=round(sum(con_votes, na.rm=TRUE)/1000000,1), lab=round(sum(lab_votes, na.rm=TRUE)/1000000,1), total=round(sum(electorate, na.rm=TRUE)/1000000,1)) %>% dt()