d<- COVID19::covid19()
d$admin<-d$administrative_area_level_1
d %>% group_by(admin) %>% summarise(tests=max(tests, na.rm=TRUE),cases=max(confirmed,na.rm=TRUE) ,deaths=max(deaths, na.rm=TRUE), population = max(population, na.rm=TRUE)) -> d
d$tests_per<-d$tests/(d$population)
d$cases_per<-d$cases/(d$population/10000)
d$deaths_per<-d$deaths/(d$population/10000)
ggplot(d,aes(x=tests_per,y=deaths_per, label=admin) ) + geom_text(size=1.4) + geom_smooth(method="lm") + xlab("Tests per capita") + ylab ("Total covid related deaths per 10k of the population") + scale_x_continuous(trans='log10')