Skip to content

Instantly share code, notes, and snippets.

# Recreate a chart by Ben Phillips on the % of (civilian 15+) adults
# in couple-only households from the ABS Labour Force Survey
# https://x.com/BenPhillips_ANU/status/1777555189568057712
library(readabs)
library(tidyverse)
fm2 <- read_lfs_datacube("fm2")
theme_ben <- function(...) {
library(auseconhist) # remotes::install_github("MattCowgill/auseconhist")
library(readabs)
library(tidyverse)
library(slider)
butlin <- auseconhist::butlin_t7 |>
filter(!is.na(awe),
year >= 1901) |>
select(date = year, value = awe, cpi) |>
mutate(series = "awe",
library(auseconhist) # remotes::install_github("MattCowgill/auseconhist")
library(readabs)
library(tidyverse)
library(slider)
butlin <- auseconhist::butlin_t7 |>
filter(!is.na(awe),
year >= 1901) |>
select(date = year, value = awe, cpi) |>
mutate(series = "awe",
library(readabs)
library(tidyverse)
gf_cur <- read_lfs_grossflows("current")
gf_prev <- read_lfs_grossflows("previous")
ur_incoming <- gf_cur |>
filter(lfs_previous == "Incoming rotation group") |>
group_by(lfs_current, date) |>
summarise(value = sum(persons)) |>
library(tidyverse)
cols <- c("#57aed7",
"#fab649",
"#c51954")
n_obs <- 1000
fake_data <- tibble(`Group A` = rnorm(n_obs, -1),
`Group B` = rnorm(n_obs, 0),
library(fredr)
library(tidyverse)
layoffs <- fredr_series_observations("JTSLDL")
layoffs |>
ggplot(aes(x = date, y = value)) +
geom_line() +
coord_cartesian(ylim = c(0, 3000)) +
theme_minimal() +
library(fredr)
library(tidyverse)
layoffs <- fredr_series_observations("JTSLDL")
layoffs |>
ggplot(aes(x = date, y = value)) +
geom_line() +
coord_cartesian(ylim = c(0, 3000)) +
theme_minimal() +
library(OECD)
library(tidyverse)
aus_thresh <- OECD::get_dataset("TABLE_I7", "AUS.THRESHOLD") |>
janitor::clean_names() |>
mutate(across(c(obs_value, time),
as.numeric))
aus_thresh |>
ggplot(aes(x = time, y = obs_value)) +
@MattCowgill
MattCowgill / cor_wpi_cpi.R
Created January 21, 2024 22:55
Correlation between quarterly growth in WPI and CPI
library(tidyverse)
library(readabs)
cpi_sa <- read_abs_series("A3604507J") |>
select(date, cpi = value) |>
filter(!is.na(cpi))
wpi_sa <- read_abs_series("A83895395V") |>
select(date, wpi = value) |>
filter(!is.na(wpi))
library(readrba)
library(readabs)
library(tidyverse)
library(gganimate)
library(ggdirectlabel)
min_date <- ymd("1990-01-01")
unemp_forecasts <- read_forecasts() |>
filter(