abs_search: Search dataset information from the ABS.Stat API

Description Usage Arguments Value Note Author(s) Examples

View source: R/abs-api-functions.R

Description

This function finds datasets or dimensions within a specific that match a specified regular expresion and returns matching results.

Usage

1
2
3
4
5
6
7
abs_search(
  pattern,
  dataset = NULL,
  ignore.case = TRUE,
  code_only = FALSE,
  update_cache = FALSE
)

Arguments

pattern

Character string or regular expression to be matched.

dataset

Character vector of ABS.Stat dataset codes. These codes correspond to the indicatorID column from the indicator data frame of abs_cache or abs_cachelist, or the result of abs_indicators. If NULL (default), then function undertakes a dataset mode search. If not NULL, function searches all dimensions of specified dataset.

ignore.case

Case senstive pattern match or not.

code_only

If FALSE (default), all column/fields are returned. If TRUE, only the dataset identifier or indicator code are returned.

update_cache

Logical expression, if FALSE (default), use the cached list of available ABS.Stat datasets, if TRUE, update the list of available datasets.

Value

A data frame with datasets and data items that match the search pattern.

Note

With acknowledgements to wb_search function.

Author(s)

David Mitchell <david.pk.mitchell@gmail.com>

Examples

1
2
3
4
5
6
7
8
 ## ABS dataset search
 x <- abs_search(pattern = "consumer price index")
 x <- abs_search(pattern = "census")
 x <- abs_search(pattern = "labour force")

 ## ABS indicator search
 x <- abs_search(pattern = "all groups", dataset="CPI")
 x <- abs_search(pattern = c("all groups", "capital cities"), dataset="CPI")

raustats documentation built on Jan. 11, 2020, 9:31 a.m.