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

View source: R/api.R

define_extract_from_jsonR Documentation

Create an extract object from a JSON-formatted definition

Description

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

Usage

define_extract_from_json(extract_json, collection)

Arguments

extract_json

A JSON string, or the path to file containing JSON.

collection

The IPUMS data collection for the extract.

Value

An object of class "ipums_extract".

See Also

Other ipums_api: define_extract_micro(), 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(), revise_extract_micro(), save_extract_as_json(), submit_extract(), wait_for_extract()

Examples

my_extract <- define_extract_micro("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, "usa")

identical(my_extract, copy_of_my_extract)


mnpopcenter/ipumsr documentation built on Sept. 30, 2022, 6:56 a.m.