Skip to content

Instantly share code, notes, and snippets.

@MattCowgill
Created November 17, 2022 01:39
Show Gist options
  • Save MattCowgill/9c111902287400241ffba0fb44d15a6d to your computer and use it in GitHub Desktop.
Save MattCowgill/9c111902287400241ffba0fb44d15a6d to your computer and use it in GitHub Desktop.
# This code provides a way to download table(s) from the Estimate Dwelling Stock
# release, which has not (yet) been added to the ABS Time Series Directory
# and therefore cannot be loaded by readabs::read_abs()
get_dwell_table <- function(table_no = 1, path = tempdir()) {
table_no <- match.arg(as.character(table_no), as.character(1:9))
filename <- paste0("87010", table_no, ".xlsx")
file <- readabs::download_abs_data_cube("estimated-dwelling-stock",
filename,
path = path)
readabs::read_abs_local(filenames = file)
}
# Get a single table
get_dwell_table(1)
# Get all tables
purrr::map_dfr(1:9,
get_dwell_table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment