Define an IPUMS USA extract request to be submitted via the IPUMS microdata
extract API. For an overview of ipumsr microdata API functionality, see
vignette("ipums-api", package = "ipumsr")
.
define_extract_usa(
description,
samples,
variables,
data_format = c("fixed_width", "csv", "stata", "spss", "sas9"),
data_structure = "rectangular",
rectangular_on = "P"
)
An object of class c("usa_extract", "ipums_extract")
containing the extract definition.
Description of the extract.
Character vector of samples to include in the extract. Samples should be specified using the sample ID values.
Character vector of variables to include in the extract.
The desired format of the extract data file (one of "fixed_width", "csv", "stata", "spss", or "sas9").
Currently, this must be "rectangular", which is also the default. In the future, the API will also support "hierarchical" extracts.
Currently, this must be "P", indicating that the
extract will be rectangularized on person records. In the future, the API
will also support household-only extracts (rectangular_on = "H"
).
Other ipums_api:
add_to_extract()
,
define_extract_cps()
,
define_extract_from_json()
,
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()
my_extract <- define_extract_usa("Example", "us2013a", "YEAR")
Run the code above in your browser using DataLab