Skip to content

Instantly share code, notes, and snippets.

@thoughtfulbloke
thoughtfulbloke / provision_results.csv
Created November 8, 2026 06:55
General Election NZ 2026 provisional results
Electorate ElectorateNo Candidate CandidateVotes Party PartyVotes
Waitākere 56 ABEL, Steve 4625 Green Party 5830
Māngere 22 AFEAKI, Hine 167 NZ Outdoors & Freedom Party 19
Ōtāhuhu 34 ALCOCK, John 142 New Zealand Loyal 52
Wairarapa 55 ALE, Victoria 62 Alliance Party 56
Wigram 64 ALEXANDER, William Donald 136 Free Palestine 46
Rangitata 39 ALLRED, Aaron 951 ACT New Zealand 5301
Māngere 22 ALP, Kelvyn 36 New Zealand Loyal 27
Maungakiekie 24 ALVAREZ DE LUGO, Juan 817 ACT New Zealand 2928
Hutt South 15 ANDERSEN, Ginny 17957 Labour Party 14599
@thoughtfulbloke
thoughtfulbloke / NZSARIflu.csv
Last active October 19, 2026 07:39
Flu sari hospitalisations in Auckland per 100000
Weekn Yearn WeekEnding flu100k covid100k
1 2022 05/01/2022 0
2 2022 12/01/2022 0
3 2022 19/01/2022 0
4 2022 26/01/2022 0
5 2022 02/02/2022 0
6 2022 09/02/2022 0
7 2022 16/02/2022 0
8 2022 23/02/2022 0
9 2022 02/03/2022 0
@thoughtfulbloke
thoughtfulbloke / I94_asof2026_8.R
Last active August 12, 2026 21:46
I94 processing with theming
############################################################
# US International Visitor Arrivals Analysis
#
# Purpose:
# Analyse changes in international visitor arrivals to the
# United States using I-94 arrival data. The chart compares
# rolling 12-month visitor volumes against November 2024,
# using that month as a 100-point baseline.
############################################################
library(dplyr)
library(lubridate)
library(ggplot2)
source("~/theme.R")
# skimr::skim(cycle_all)
#
# ── Data Summary ────────────────────────
# Values
# Name cycle_all
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
"Course.Code","Teacher","Campus","Remote","Course.Content","Course.Delivery","Other.comments","rating"
"XMPL101","Mary","Dunedin","Online","Content was well structured and relevant to the course goals.","Delivery was clear and easy to follow.","Overall I was satisfied with the course.",3
"XMPL101","Mary","Dunedin","Online","Content covered many useful topics but some areas felt a bit shallow.","Delivery was generally good but the pace was sometimes too fast.","I would have liked more time for questions.",4
"XMPL101","Mary","Dunedin","Online","Content was challenging in a good way and made me think deeply.","Delivery included helpful explanations and examples.","I feel more confident in this subject now.",8
"XMPL101","Mary","Dunedin","Online","Content sometimes jumped between topics which was confusing.","Delivery could have been more organized from week to week.","I occasionally felt lost during the middle of the semester.",6
"XMPL101","Mary","Dunedin","Online","Content linked theory to practice in a meaningf
We can't make this file beautiful and searchable because it's too large.
Country,Trainer,Recommend,Comments
Australia,Mary,3,Training was easy to follow
Australia,Mary,2,The session was informative
Australia,Mary,8,Session met my expectations
Australia,Mary,10,Helpful and well structured training
Australia,Mary,2,I learned new skills today
Australia,Mary,10,Overall a positive experience
Australia,Mary,2,Helpful and well structured training
Australia,Mary,3,Very useful training session
Australia,Mary,9,Would recommend this training
# The microsoft report whose number use makesme sad
# New Zealand’s Generative AI opportunity
# https://msftstories.thesourcemediaassets.com/sites/433/2024/08/New-Zealands-Generative-AI-Opportunity.pdf
# impact to date
# UNDERSTANDING AOTEAROA NEW ZEALAND: THE IPSOS AI MONITOR 2025
# https://www.ipsos.com/sites/default/files/ct/news/documents/2025-08/Ipsos-AI-Monitor-2025%20NZ%20version.pdf
# productivity
# https://infoshare.stats.govt.nz
@thoughtfulbloke
thoughtfulbloke / emergency_states.R
Last active April 22, 2026 10:59
Code for converting a saved webpages of NZ States of Emergency to a graph of time in emergency
# https://www.civildefence.govt.nz/emergency-events/previous-emergencies/declared-states-of-emergency
# Declared state of emergency page, save locally as an html page
# in the working directory called em.html
library(rvest)
library(dplyr)
library(lubridate)
library(ggplot2)
source("~/theme.R")
library(dplyr)
library(tidyr)
library(readxl)
library(readr)
library(ggplot2)
library(lubridate)
library(slider)
source("~/theme.R")
p2 <- "https://www.trade.gov/i-94-arrivals-program"
library(dplyr)
library(lubridate)
library(ggplot2)
library(readr)
source("~/theme.R")
Rain <- read_csv("2810__Rain__daily.csv")
Gust <- read_csv("2810__Gust__daily.csv")
col_background = "#DDDDDD"
col_rain = "#56B4E9"