scb_create_cache: Create cache of database

Description Usage Arguments Details Value Examples

Description

Creates a local and condensed copy of the given database at www.scb.se, for the given language, with the option of starting at a particular ID path to only cache a subset of the data.

Usage

1
scb_create_cache(lang = "en", database_id = "ssd", initial_id = "")

Arguments

lang

Supported languages: "en" English

database_id

Supported databases: "ssd"

initial_id

From where to start caching: default top level

Details

The function is only tested with the "ssd" database, as that is the only one that can be queried through this package and the API as of March 2019. The output is condensed to reduce file size - the full structure can be seen in scb_cache or by loading "data/scb_cache.rda".

The function recursively calls scb_list through add_directory_to_cache. For each directory, the ID path and text description is stored. For tables, in addition to the ID path and text description, the variables, values, and date range present in the table is also stored.

Value

Data.frame containing id, depth, type, name, variable and value descriptions, and date range for each directory, subdirectory, and table in the database

Examples

1
2
3
4
5
## Not run: 
scb_cache <- scb_create_cache(lang = "en")
scb_AM0101_cache <- scb_create_cache(lang = "en", initial_id = "AM/AM0101")

## End(Not run)

olhmr/rscb documentation built on May 15, 2019, 10:40 p.m.