dwp_schema: API Schema

Description Usage Arguments Details Value Examples

View source: R/schema.R

Description

Schema data is metadata on the datasets and folders available at the root level of Stat-Xplore. More details on the schema endpoint is available in the API documentation

Usage

1

Arguments

id

If NULL, returns all folders and databases available at the root level of the API. If the id of a folder, database, etc, returns all folders, databases, and variables at the level below. id is case sensitive. Defaults to NULL.

Details

dwp_schema can be used iteratively to get folders and databases at each level.

The function will work with or without "str:" at the start of each ID string. id="str:database:ESA_Caseload" and id="database:ESA_Caseload" will return the same data, but a query like id="r:database:ESA_Caseload" will fail.

Value

A tibble with the relevant

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
#Get all available folders
a <- dwp_schema()

# Get all databases in the ESA folder
b <- dwp_schema("str:folder:fesa")

# Get all variables in the ESA caseload database
c <- dwp_schema("str:database:ESA_Caseload")

# Given their ID, you can use `dwp_schema` to return the names of levels
# in group and field variables
d <- dwp_schema("str:field:ESA_Caseload:V_F_ESA:CTDURTN")

# Returns a tibble of levels for the duration options for ESA caseloads
e <- dwp_schema("str:valueset:ESA_Caseload:V_F_ESA:CTDURTN:C_ESA_DURATION")

## End(Not run)

evanodell/dwpstat documentation built on Feb. 14, 2020, 3:54 p.m.