Learn R Programming

PxWebApiData (version 1.9.0)

meta_code_list: PxWebApi v2 metadata for a code list

Description

Retrieves metadata for a code list and returns it as an R object.

Usage

meta_code_list(url, as_frame = TRUE)

Value

An R object containing metadata for the code list. When as_frame = TRUE, the result is a data frame.

Arguments

url

A PxWebApi v2 URL to metadata for a code list.

as_frame

Logical. When TRUE, the metadata is structured as a data frame, with additional information stored in an attribute named "extra".

Examples

Run this code
metaframes <- meta_frames(7459, url_type = "ssb_en")
url <- attr(metaframes[["Region"]], "code_lists")[["links"]][3]
print(url)

df <- meta_code_list(url)

print(df)
print(attr(df, "extra")[1:3])

Run the code above in your browser using DataLab