get_metadata_nhgis {ipumsr}R Documentation

List available data sources from IPUMS NHGIS

Description

[Deprecated]

This function has been deprecated because the IPUMS API now supports metadata endpoints for multiple data collections. To obtain summary metadata, please use get_metadata_catalog(). To obtain detailed metadata, please use get_metadata().

Learn more about the IPUMS API in vignette("ipums-api") and aggregate data extract definitions in vignette("ipums-api-agg").

Usage

get_metadata_nhgis(
  type = NULL,
  dataset = NULL,
  data_table = NULL,
  time_series_table = NULL,
  delay = 0,
  api_key = Sys.getenv("IPUMS_API_KEY")
)

Arguments

type

One of "datasets", "data_tables", "time_series_tables", or "shapefiles" indicating the type of summary metadata to retrieve. Leave NULL if requesting metadata for a single dataset, data_table, or time_series_table.

dataset

Name of an individual dataset for which to retrieve metadata.

data_table

Name of an individual data table for which to retrieve metadata. If provided, an associated dataset must also be specified.

time_series_table

Name of an individual time series table for which to retrieve metadata.

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 metadata records without exceeding the API rate limit.

Only used if type is provided.

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

If type is provided, a tibble of summary metadata for all data sources of the provided type. Otherwise, a named list of metadata for the specified dataset, data_table, or time_series_table.

Metadata availability

The following sections summarize the metadata fields provided for each data type. Summary metadata include a subset of the fields provided for individual data sources.

Datasets:

Data tables:

Time series tables:

Shapefiles:

See Also

define_extract_agg() to create an IPUMS aggregate data extract definition.

Examples

## Not run: 
library(dplyr)

# Get summary metadata for all available sources of a given data type
# Previously:
get_metadata_nhgis("datasets")

# Now:
get_metadata_catalog("nhgis", "datasets")

# Get detailed metadata for a single source with its associated argument
# Previously:
cs5_meta <- get_metadata_nhgis(time_series_table = "CS5")

# Now:
cs5_meta <- get_metadata("nhgis", time_series_table = "CS5")

cs5_meta$geog_levels

# Use the available values when defining an NHGIS extract request
define_extract_agg(
  "nhgis",
  time_series_tables = tst_spec("CS5", geog_levels = "state")
)

## End(Not run)

[Package ipumsr version 0.9.0 Index]