read_release: read_release

View source: R/read_release.R

read_releaseR Documentation

read_release

Description

Returns the dataset releases for the given dataflow - agencyid:id(version) and data provider - agencyid:id, as a list. A number of utilities are provided to filter only the releases of interest, detailed below.

Usage

read_release(id, ..., tidy = FALSE)

Arguments

id

Data identifier.

...

Further Optional arguments:

agencyid Agency responsible for the data definition.
version Version of the data definition.
provideragencyid Agency responsible for making the data available.
providerid Provider of the data.
newest logical. Returns only the latest release in the results.
oldest logical. Returns only the oldest release in the results.
beforedatetime datetime. Returns all releases before a certain date (can be used with newest).
afterdatetime datetime. Returns all releases after a certain date (can be used with oldest).
includestext character. Returns all releases that contain the given string in their description (can be used with oldest or newest).
releasedescription character. Returns the release whose description is most similar to the given string.
returnrange boolean. Returns the data set range for each returned release.
username character. EconData username.
password character. EconData password.
tidy

logical. Return releases in a tidy data.table (see Value) with "metadata" attached in an attribute.

Details

Specifying the full dataflow and data provider details (as opposed to only using the data id) allows more fine-grained control over the data set being queried. This is not necessary if there is only a single definition of the data and a single provider, which is typically the case.

An EconData account (http://app.econdata.co.za) is required to use this function. The user must provide their credentials either through the function arguments, or by setting the ECONDATA_CREDENTIALS environment variable using the syntax: "username;password". If credentials are not supplied by the aforementioned methods a GUI dialog will prompt the user for credentials.

Value

If tidy = FALSE, a nested lists containing metadata and release desciption and dates. If tidy = TRUE, a (list of) data.table(s) providing release information, with metadata attached as an attribute.

See Also

write_release

Examples

## Not run: 
# library(econdatar)
# Sys.setenv(ECONDATA_CREDENTIALS="username;password")
# Ids see: https://www.econdata.co.za/FusionRegistry/data/datastructure.html

# Bank Balance Sheet (institutional)
BA900_RELEASE <- read_release(id = "BA900")
# Same as: read_release(id = "BA900", tidy = TRUE)
econdata_tidy(BA900_RELEASE, release = TRUE)      # No further options supported.

# Releases for all CPI Revisions
read_econdata(id = "CPI_ANL_SERIES", tidy = TRUE)

## End(Not run)

byrongibby/econdatar documentation built on March 18, 2023, 9:30 p.m.