Revise an extract definition. If the supplied extract definition comes from a previously submitted extract, this function will reset the definition to an unsubmitted state. For an overview of ipumsr API functionality, see vignette("ipums-api", package = "ipumsr").

revise_extract(
  extract,
  description = NULL,
  samples_to_add = NULL,
  samples_to_remove = NULL,
  vars_to_add = NULL,
  vars_to_remove = NULL,
  data_format = NULL,
  data_structure = NULL,
  rectangular_on = NULL
)

Arguments

extract

An object of class ipums_extract.

description

The modified extract description. If NULL (the default), leave the description unchanged.

samples_to_add

Samples to add to the extract definition, as a character vector. If NULL (the default), no samples will be added.

samples_to_remove

Samples to remove from the extract definition, as a character vector. If NULL (the default), no samples will be removed.

vars_to_add

Names of variables to add to the extract definition, as a character vector. If NULL (the default), no variables will be added.

vars_to_remove

Names of variables to remove from the extract definition, as a character vector. If NULL (the default), no variables will be removed.

data_format

The desired data file format for the modified extract definition. If NULL (the default), leave the data format unchanged.

data_structure

The desired data structure. Currently, this can only be "rectangular", but "hierarchical" extracts will be supported in the future. If NULL (the default), leave the data structure unchanged.

rectangular_on

Currently, this can only be "P", but in the future, household-only extracts (rectangular_on = "H") will also be supported. If NULL, (the default), leave the rectangular_on field unchanged.

Value

An object of class ipums_extract containing the modified extract definition.

See also

Examples

if (FALSE) {
old_extract <- get_extract_info("usa:33")

revised_extract <- revise_extract(
  old_extract,
  samples_to_add = "us2018a",
  vars_to_add = "INCTOT"
)

submitted_revised_extract <- submit_extract(revised_extract)
}