get_sample_info: List available samples for IPUMS microdata collections

View source: R/api_metadata.R

get_sample_infoR Documentation

List available samples for IPUMS microdata collections

Description

Retrieve sample IDs and descriptions for IPUMS microdata collections.

Currently supported microdata collections are:

  • IPUMS USA ("usa")

  • IPUMS CPS ("cps")

  • IPUMS International ("ipumsi")

  • IPUMS Time Use ("atus", "ahtus", "mtus")

  • IPUMS Health Surveys ("nhis", "meps")

Learn more about the IPUMS API in vignette("ipums-api").

Usage

get_sample_info(
  collection = NULL,
  delay = 0,
  api_key = Sys.getenv("IPUMS_API_KEY")
)

Arguments

collection

Character string of the IPUMS collection for which to retrieve sample IDs. Defaults to the current default collection, if it exists. See set_ipums_default_collection().

For a list of codes used to refer to each collection, see ipums_data_collections().

delay

Number of seconds to delay between successive API requests, if multiple requests are needed to retrieve all records.

A delay is highly unlikely to be necessary and is intended only as a fallback in the event that you cannot retrieve all sample IDs without exceeding the API rate limit.

api_key

API key associated with your user account. Defaults to the value of the IPUMS_API_KEY environment variable. See set_ipums_api_key().

Value

A tibble containing sample IDs and descriptions for the indicated collection.

See Also

define_extract_micro() to create an IPUMS microdata extract definition.

Examples

## Not run: 
get_sample_info("usa")
get_sample_info("cps")
get_sample_info("ipumsi")
get_sample_info("atus")
get_sample_info("meps")

## End(Not run)

ipumsr documentation built on Sept. 12, 2024, 7:38 a.m.