Learn R Programming

ipumsr (version 0.5.2)

define_extract_from_json: Create an ipums_extract object from a JSON-formatted definition

Description

Create an ipums_extract object based on an extract definition formatted as JSON. For an overview of ipumsr microdata API functionality, see vignette("ipums-api", package = "ipumsr").

Usage

define_extract_from_json(extract_json)

Value

An ipums_extract object.

Arguments

extract_json

The path to a file containing the JSON definition, or a JSON string.

See Also

Other ipums_api: add_to_extract(), define_extract_cps(), define_extract_usa(), download_extract(), extract_list_to_tbl(), extract_tbl_to_list(), get_extract_info(), get_last_extract_info(), get_recent_extracts_info, ipums_data_collections(), is_extract_ready(), remove_from_extract(), save_extract_as_json(), set_ipums_api_key(), submit_extract(), wait_for_extract()

Examples

Run this code
my_extract <- define_extract_usa("Example", "us2013a", "YEAR")

extract_json_path <- file.path(tempdir(), "usa_extract.json")
save_extract_as_json(my_extract, file = extract_json_path)

copy_of_my_extract <- define_extract_from_json(extract_json_path)

identical(my_extract, copy_of_my_extract)

Run the code above in your browser using DataLab