is_extract_ready | R Documentation |
This function uses the IPUMS API to check whether the given extract is ready
to download, returning TRUE for extracts that are ready and FALSE for those
that are not. For an overview of ipumsr API functionality, see
vignette("ipums-api", package = "ipumsr")
.
is_extract_ready(extract, api_key = Sys.getenv("IPUMS_API_KEY"))
extract |
One of:
The extract number does not need to be zero-padded (e.g., use |
api_key |
API key associated with your user account. Defaults to the value of environment variable "IPUMS_API_KEY". |
This function checks the "download_links" element of the supplied extract to
determine whether the extract files are available to download.
The "status" of a submitted extract is one of "queued", "started", "produced",
"canceled", "failed", or "completed". Only "completed" extracts can be ready
to download, but not all "completed" extracts are ready to download, because
extract files are subject to removal from the IPUMS servers 72 hours after
they first become available. Completed extracts older than 72 hours will
still have a "completed" status, but will return FALSE
from
is_extract_ready()
, because the extract files are no longer available.
A logical vector of length one.
Other ipums_api:
define_extract_from_json()
,
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()
,
revise_extract_micro()
,
save_extract_as_json()
,
submit_extract()
,
wait_for_extract()
my_extract <- define_extract_micro("usa", "Example", "us2013a", "YEAR") ## Not run: submitted_extract <- submit_extract(my_extract) # Check if extract is ready by supplying extract object: is_extract_ready(submitted_extract) # By supplying the data collection and extract number, as a string: is_extract_ready("usa:1") # Note that there is no space before or after the colon, and no zero-padding # of the extract number. # By supplying the data collection and extract number, as a vector: is_extract_ready(c("usa", "1")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.