This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get a clipped map of territorial authorities, like | |
| # https://koordinates.com/from/datafinder.stats.govt.nz/layer/123496-territorial-authority-2026-clipped/ | |
| # download (needs registration) in a format useful you. I used | |
| # Coordinate Reference System WGS 84 (EPSG:4326)) and as a .kml file (21MB) | |
| # | |
| # download territorial population like from | |
| # https://infoshare.stats.govt.nz Population : Population Estimates (DPE) | |
| # Estimated Resident Population for Territorial Authority Areas, at 30 June(1996+) (Annual-Jun) | |
| # as a csv for the year 2025 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readr) | |
| library(dplyr) | |
| library(tidyr) | |
| library(lubridate) | |
| library(ggplot2) | |
| library(ggthemes) | |
| gn <- read_csv("202601_Generation_MD.csv") | |
| ex <- read_csv("202601_Grid_export.csv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(ggthemes) | |
| six_cols <- colorblind_pal()(6) | |
| make_footer <- function(x){ | |
| paste0(x,"\n Made by David Hood, ", Sys.Date()) | |
| } | |
| bodyfont <- "Lexend Deca Thin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BCDate | ANZBC | GDPI_income_actual | GDPI_income_seasonallyAdjusted | |
|---|---|---|---|---|
| 2008-01-30 | ||||
| 2008-04-30 | -54.8 | |||
| 2008-05-27 | -49.7 | |||
| 2008-06-30 | -38.7 | |||
| 2008-07-31 | -43.2 | |||
| 2008-08-27 | -20.5 | |||
| 2008-09-30 | 1.6 | |||
| 2008-10-30 | -42.3 | |||
| 2008-11-27 | -43 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Weekn | Yearn | WeekEnding | Rate100k | |
|---|---|---|---|---|
| 1 | 2022 | 2022-01-05 | 0 | |
| 2 | 2022 | 2022-01-12 | 0 | |
| 3 | 2022 | 2022-01-19 | 0 | |
| 4 | 2022 | 2022-01-26 | 0 | |
| 5 | 2022 | 2022-02-02 | 0 | |
| 6 | 2022 | 2022-02-09 | 0 | |
| 7 | 2022 | 2022-02-16 | 0 | |
| 8 | 2022 | 2022-02-23 | 0 | |
| 9 | 2022 | 2022-03-02 | 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(dplyr) | |
| library(geosphere) | |
| library(suncalc) | |
| library(lubridate) | |
| library(mapdata) | |
| source("~/theme.R") | |
| #21:25 locally is UTC 2025-11-11 08:25:00 at this time of year | |
| # -47.5, 166 | |
| # -34.5, 180 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(foreign) | |
| library(dplyr) | |
| library(tidyr) | |
| library(ggplot2) | |
| library(viridis) | |
| library(ggpattern) | |
| source("../theme.R") | |
| sav23 <- suppressWarnings(read.spss("2_NZES23Release_100227.sav", | |
| to.data.frame = TRUE, add.undeclared.levels = "sort")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readr) | |
| library(dplyr) | |
| library(tidyr) | |
| library(ggplot2) | |
| library(lubridate) | |
| library(RcppRoll) | |
| source("~/theme.R") | |
| datafiles <- list.files(pattern="csv$") | |
| # remove the older provisional files that I have the directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readr) | |
| library(dplyr) | |
| library(tidyr) | |
| library(ggplot2) | |
| library(ggthemes) | |
| source("~/theme.R") | |
| WVS <- read_csv("~/Downloads/WVS_Cross-National_Wave_7_csv_v6_0.csv") | |
| shorter <- WVS |> | |
| filter(B_COUNTRY_ALPHA %in% c("DEU", "RUS","IND", "USA", "KOR", "NZL")) |> | |
| select(B_COUNTRY_ALPHA, Q7:Q17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(maps) | |
| library(dplyr) | |
| # while the position data in the maps package | |
| # is very basic, that makes it simple to transform | |
| nz_map <- map_data("nz") | |
| nz_anti <- nz_map %>% | |
| mutate( |
NewerOlder