Skip to content

Instantly share code, notes, and snippets.

@MattCowgill
Created December 6, 2022 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattCowgill/8233a806d368627ae92faf380e06e81c to your computer and use it in GitHub Desktop.
Save MattCowgill/8233a806d368627ae92faf380e06e81c to your computer and use it in GitHub Desktop.
library(tidyverse)
library(readabs)
library(data.table)
uq2a_dt <- download_abs_data_cube(catalogue_string = "labour-force-australia-detailed",
cube = "UQ2a") |>
readxl::read_excel(sheet = "Data 1",
skip = 3) |>
janitor::clean_names() |>
as.data.table()
uq2a_dt[, `:=`(date = as.Date(date))][date >= ymd("2002-01-01")][,`:=`(reason = reason_left_or_lost_last_job)][, .(unemployed = sum(unemployed_looked_for_full_time_work_000 + unemployed_looked_for_only_part_time_work_000)), keyby = .(date, reason)][reason %in% c("Left last job", "Lost last job")] |>
ggplot(aes(x = date, y = unemployed, col = reason)) +
geom_line() +
ggthemes::theme_excel()
@MattCowgill
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment