get_last_extract_info: Get information on last extract

View source: R/api.R

get_last_extract_infoR Documentation

Get information on last extract

Description

Get information on your most recent extract for a given IPUMS data collection, returned as an ipums_extract object. For an overview of ipumsr microdata API functionality, see vignette("ipums-api", package = "ipumsr").

Usage

get_last_extract_info(collection, api_key = Sys.getenv("IPUMS_API_KEY"))

Arguments

collection

The code for an IPUMS data collection. For a list of the codes used to refer to the data collections, see ipums_data_collections().

api_key

API key associated with your user account. Defaults to the value of environment variable "IPUMS_API_KEY".

Value

An ipums_extract object containing information on your most recent extract.

See Also

Other ipums_api: add_to_extract(), define_extract_cps(), define_extract_from_json(), define_extract_usa(), download_extract(), extract_list_to_tbl(), extract_tbl_to_list(), get_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

my_extract <- define_extract_usa("Example", "us2013a", "YEAR")

## Not run: 
submit_extract(my_extract)

# Oops, forgot to capture the return object from submit_extract. Grab it with:
submitted_extract <- get_last_extract_info("usa")

# View the extract number
submitted_extract$number

# Check if submitted extract is ready
is_extract_ready(submitted_extract) # returns TRUE or FALSE

# Or have R check periodically until the extract is ready
downloadable_extract <- wait_for_extract(submitted_extract)

## End(Not run)


ipumsr documentation built on Sept. 30, 2022, 9:05 a.m.