my_extract <- define_extract_micro(
collection = "ipumsi",
description = "Botswana data",
samples = c("bw2001a", "bw2011a"),
variables = c("SEX", "AGE", "YEAR")
)
if (FALSE) {
submitted_extract <- submit_extract(my_extract)
# Wait for a particular extract request to complete by providing its
# associated `ipums_extract` object:
downloadable_extract <- wait_for_extract(submitted_extract)
# Or by specifying the collection and number for the extract request:
downloadable_extract <- wait_for_extract("ipumsi:1")
# If you have a default collection, you can use the extract number alone:
set_ipums_default_collection("ipumsi")
downloadable_extract <- wait_for_extract(1)
# Use `download_extract()` to download the completed extract:
files <- download_extract(downloadable_extract)
# Use `is_extract_ready()` if you don't want to tie up your R session by
# waiting for completion
is_extract_ready("usa:1")
}
Run the code above in your browser using DataLab