Skip to content

Instantly share code, notes, and snippets.

library(dplyr)
library(lubridate)
library(readr)
library(RcppRoll)
library(ggplot2)
library(ggthemes)
sixcols= colorblind_pal()(6)
case_counts <- read_csv("https://raw.githubusercontent.com/minhealthnz/nz-covid-data/main/cases/covid-case-counts.csv")
```{r}
library(readr)
library(dplyr)
library(lubridate)
```
David's usage notes for the wastewater data at: https://github.com/ESR-NZ/covid_in_wastewater
I am reading the files directly of github, rather than downloading and then reading locally.
library(rvest) # process web pages
library(dplyr) # general data pipeleine tools
library(lubridate) # date functions
# saving demographic pages as html into a folder
# called case_demografics_html_asof
# with a datestamp name for the contents
Demographs <- list.files("../case_demografics_html_asof", pattern=".*html$")
extract_vax <- function(x) {
# source this file so it pauses for input,
# check the graphs
# add comments via the readline input
# post using rtweet
library(rvest)
library(dplyr)
library(ggplot2)
library(lubridate)
library(rtweet)
library(rvest)
library(dplyr)
library(lubridate)
library(stringr)
library(readr)
library(ggplot2)
library(ggthemes)
library(RcppRoll)
sixcol <- colorblind_pal()(6)
@thoughtfulbloke
thoughtfulbloke / excess_mort_2022.R
Created May 6, 2022 01:49
Population Data from Infoshare (quarterly, as at, DPE). Deaths from StatsNZ open data API, but also in their Covid data portal
legpos="right"
theme_davidhood <- function(){
# theme_minimal(base_family="OpenSans") %+replace%
theme_minimal() %+replace%
theme(panel.grid = element_blank(),
axis.line.x = element_line(size=0.1),
axis.line.y = element_line(size=0.1),
axis.ticks = element_line(size=0.2),
strip.background = element_rect(fill= "#FFFFFF", colour="#EFEFEF"),
strip.text = element_text(size = 13,
library(rvest)
library(dplyr)
library(tidyr)
library(lubridate)
library(stringr)
library(readr)
library(ggplot2)
library(ggthemes)
library(patchwork)
source("davidise.R")
library(rvest)
library(readr)
library(dplyr)
library(tidyr)
library(lubridate)
#######
# assuming the DHB subnational population file downloaded
# and cached in the working directory from
# https://figure.nz/table/vEnTmdKKixC0HrEF
Date Category Unvaxed partvaxed fullvaxed under12 ChangeUn Change2 Pop2 Pop1 PopU Unv100K Two100K ThreeDayU ThreeDay2
2021-11-27 Cases 3404 1661 1080 1830
2021-11-28 Cases 3449 1681 1112 1876 45 32
2021-11-29 Cases 3491 1711 1158 1938 42 46
2021-11-30 Cases 3518 1737 1194 1982 27 36
2021-12-01 Cases 3563 1759 1223 2029 45 29
2021-12-02 Cases 3623 1786 1266 2070 60 43
2021-12-03 Cases 3651 1812 1290 2083 28 24
2021-12-04 Cases 3677 1832 1317 2105 26 27
2021-12-05 Cases 3703 1855 1348 2131 26 31
library(readr)
library(dplyr)
library(lubridate)
library(RcppRoll)
library(ggplot2)
library(ggthemes)
library(sf)
library(rmapshaper)
library(tidyr)
library(patchwork)