read_registry: read_registry

View source: R/read_registry.R

read_registryR Documentation

read_registry

Description

Returns the data for the given registry structure - agencyid:id(version).

Usage

read_registry(structure, tidy = FALSE, ...)

## S3 method for class 'eds_registry'
tidy_data(x, ...)

Arguments

structure

structure type. One of category-scheme, codelist, concept-scheme, dataflow, data-structure, memberlist, consumption-agreement, or provision-agreement

x

A raw API return object to be tidied. Can also be done directly in read_registry() by setting tidy = TRUE. See tidy below for tidying options.

...

Further Optional arguments:

agencyid character. Defaults to ECONDATA. Agency responsible for the metadata creation/maintenance.
version character. Version(s) of the data (different versions will have different metadata), or 'all' to return all available versions.
file character. File name for retrieving structures stored as JSON data from disk (output of write_registry()).
tidy

logical. Return data and metadata in tidy data.table's (see Value), by passing the result through tidy_data. Currently not used.

Details

An EconData account (http://econdata.co.za) is required to use this function. The user must provide an API token that can be found on the Account page of the online portal, a GUI dialog will prompt the user for their API token. Credentials can also be supplied by setting the ECONDATA_CREDENTIALS environment variable using the syntax: "client_id;client_secret", e.g. Sys.setenv(ECONDATA_CREDENTIALS="client_id;client_secret"), when available.

Value

If tidy = FALSE, a list detailing at a minimum the structure's agencyid, id, version, name, and description, as well as a data.frame with rows containing the data of any child structures.

See Also

write_registry

Examples

## Not run: 
# library(econdatar)

# Frequency codelist
CL_FREQ <- read_registry("codelist", id = "CL_FREQ")

## End(Not run)

coderaanalytics/econdatar documentation built on Nov. 1, 2024, 5:41 a.m.