-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
57 lines (40 loc) · 1.9 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# abs
<!-- badges: start -->
[![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)
<!-- badges: end -->
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.