An open API service indexing awesome lists of open source software.

https://github.com/asiripanich/abs

Read csv tables exported from ABS TableBuilder and ABS Census TableBuilder.
https://github.com/asiripanich/abs

abs abstablebuilder australian-bureau-of-statistics r tablebuilder

Last synced: 3 days ago
JSON representation

Read csv tables exported from ABS TableBuilder and ABS Census TableBuilder.

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# abs

[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![DOI](https://zenodo.org/badge/228950913.svg)](https://zenodo.org/badge/latestdoi/228950913)
[![R build status](https://github.com/asiripanich/abs/workflows/R-CMD-check/badge.svg)](https://github.com/asiripanich/abs/actions)

The goal of abs is to provide a function to read csv tables downloaded from ABS TableBuilder without having to 'tidy' them first. Thus, this helps ti retain the meta information of the tables.

## Table Builder

Currently, The package only works with Table Builder files downloaded as "CSV String Value (.csv)", as shown in the image below.

![pic](man/figures/download-tb-file.png)

## Installation

You can install the development version of abs from GitHub with:

``` r
remotes::install_github("asiripanich/abs")
```

## Example

The main function is `abs_read_tb()` which let you read in a TableBuilder file downloaded as "CSV String Value (.csv)" into a tidy data by ignoring all its metadata.

```{r example}
library(abs)
data_dir <- system.file("extdata", package = "abs")
test_csv <- file.path(data_dir, "tb1.csv")
mytable <- abs_read_tb(test_csv, .names = "simplify", exclude_total = TRUE)
mytable
```

Note that `abs_read_tb` returns a data.table object. To convert it back to data.frame simply use `as.data.frame()`.

## Related packages

- [readabs](https://github.com/MattCowgill/readabs): for reading time series data from ABS.
- [stplanr](https://github.com/ropensci/stplanr): has a utility function, stplanr::read_table_builder(), for reading Table Builder files.