abs_read_tb: Read tables exported from ABS Table Builder

Description Usage Arguments Value Examples

View source: R/read-tb.R

Description

This provides an simple function to read in tables from Table Builder without having to 'tidy' the tables first. The basic idea is that the function looks for the first row that has its cell value equal to 'Count' which is what appeared in all Table Builder tables. The 'Count' cell usually appear in as the last column on the table and never the first.

Usage

1
abs_read_tb(x, .names = c("asis", "simplify", "clean"), exclude_total = TRUE)

Arguments

x

path to a csv file exported from ABS Table Builder.

.names

Default as 'asis' returns names as is. "simplify" use only the abbreviations in small caps. While "clean" uses janitor::clean_names().

exclude_total

exclude rows with Total

Value

a data.table

Examples

1
2
3
data_dir <- system.file("extdata", package = "abs")
test_csv <- file.path(data_dir, "tb1.csv")
mytable <- abs_read_tb(test_csv)

asiripanich/abs documentation built on Nov. 15, 2020, 3:09 a.m.