Skip to contents

Read cached IPUMS microdata

Usage

read_ipums_micro_cached(
  filename,
  download_directory,
  extract_definition,
  refresh = FALSE
)

Arguments

filename

The name of the file (not the full file path)

download_directory

A relative path specifying where to download the data

extract_definition

A define_extract_micro() object

refresh

If true, execute the API query, even if data are already stored locally. Defaults to FALSE

Value

A dataframe corresponding to the supplied extract_definition

Examples

if (FALSE) { # \dontrun{
read_ipums_micro_cached(
  filename = "acs_insurance_race_2022_1yr_repweights",
  download_directory = "data",
  extract_definition = define_micro_extract(
    collection = "usa",
    description = "2022 ACS 1-year sample with replicate weights - insurance and race",
    samples = c("us2022a"),
    variables = list(
      "HCOVANY",
      var_spec("RACE", case_selections = c("1", "2")),
      "REPWT"),
  refresh = FALSE))
} # }