Skip to content

Instantly share code, notes, and snippets.

@thoughtfulbloke
Created December 9, 2019 05:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoughtfulbloke/dd439e5d1432f90a0f84abfc9430339c to your computer and use it in GitHub Desktop.
Save thoughtfulbloke/dd439e5d1432f90a0f84abfc9430339c to your computer and use it in GitHub Desktop.
rent change in NZ
library(readr)
geo_mean <- read_csv("https://www.mbie.govt.nz/assets/Data-Files/Building-and-construction/Tenancy-and-housing/Rental-bond-data/Territorial-Authority/ta-geometric-mean.csv",
col_types = cols(
.default = col_double(),
Month = col_date(format = "")
))
library(dplyr)
library(ggplot2)
geo_mean %>% filter(Month >= as.Date("2009-01-01")) %>%
mutate(govt = c(rep("National", 105), rep("Labour",25))) %>%
ggplot(aes(x=Month,y=`National Total`, colour=govt)) + geom_line() +
theme_minimal()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment