Skip to contents

Select a topic. If no topic is given, the first one that appears in the area is taken.

Usage

select_topic(act, topic)

# S3 method for acs_5yr_topic
select_topic(act, topic = NULL)

Arguments

act

An acs_5yr_topic object.

topic

A string, topic name.

Value

An acs_5yr_topic object.

Examples


dir <- tempdir()
source_dir <- system.file("extdata/acs_5yr", package = "geogenr")
files <- list.files(source_dir, "*.zip", full.names = TRUE)
file.copy(from = files, to = dir, overwrite = TRUE)
#> [1] TRUE TRUE
ac <- acs_5yr(dir)

files <- ac |>
  unzip_files()

act <- ac |>
  as_acs_5yr_topic("Alaska Native Regional Corporation",
                   2021,
                   "X01 Age And Sex")

act <- act |>
  select_topic(topic = "X03 Hispanic Or Latino Origin")