library(readxl)
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
## 
##     date
d <- read_excel("EMData.xlsx", sheet = "pod")

d %>% filter(`Place of Death`== "Care home (nursing or residential)") ->ch
ch<-ch[,c(4,9:12)]
names(ch)<-gsub(" ","_",names(ch))
ch$Week_Ending<-ymd(ch$Week_Ending)
str(ch)
## tibble [53 × 5] (S3: tbl_df/tbl/data.frame)
##  $ Week_Ending                                  : Date[1:53], format: "2020-03-27" "2020-04-03" ...
##  $ Registered_Deaths                            : num [1:53] 2351 3599 4714 7025 7592 ...
##  $ Expected_Deaths                              : num [1:53] 2315 2249 1913 2083 2335 ...
##  $ Excess_Deaths                                : num [1:53] 36 1350 2801 4942 5257 ...
##  $ Deaths_with_COVID-19_on_the_Death_Certificate: num [1:53] 20 189 770 1940 2675 ...
ch %>% pivot_longer(cols=2:5) -> ch1
ggplot(ch1,aes(x=Week_Ending,y=value)) +geom_line() +facet_wrap(~name)

ch %>% mutate(percent=100*`Deaths_with_COVID-19_on_the_Death_Certificate`/ Registered_Deaths) -> ch

aqm::dt(ch)
dd <- read_excel("England Care Home Vaccinations and Deaths.xlsx", 
    skip = 4)

names(dd)<-gsub(" ","_",names(dd))
names(dd)
##  [1] "Week_Ending"      "Residents"        "Eligible"         "Total_Vaccinated"
##  [5] "Newly_Vaccinated" "#"                "#^2"              "#^3"             
##  [9] "Ineligible"       "Died"             "%_of_Population"  "Died_with_COVID" 
## [13] "COVID_CFR"        "Excess"           "%_COVID"
dd$Week_Ending<-ymd(dd$Week_Ending)
dd<-na.omit(dd)

ddd<-dd[,1:4]
ddd %>% pivot_longer(cols=2:4) ->ddd
ddd %>% ggplot(aes(x=Week_Ending, y=value,color=name)) +geom_line()

aqm::dt(dd)