Skip to contents

taf_dataset() uses the arrow package to open the Hive-partitioned Parquet dataset of TIGER address features in the addr user data directory. Arrow FileSystemDataset objects are database-like backends for larger-than-memory datasets and support dplyr syntax for data manipulation; see https://arrow.apache.org/docs/r/articles/data_wrangling.html. Other TAF helpers such as taf_catalog(), taf_install(), and taf() use nanoparquet directly for flat parquet file reads and writes. Arrow is only required for the advanced dataset interface returned by taf_dataset().

Usage

taf_dataset(year = as.character(2025:2011), version = "v2")

Arguments

year

character, length one; vintage of TIGER addrfeat (address feature) files

version

character, length one; major version of the package and taf dataset schema

Value

a Dataset R6 object (see ?arrow::open_dataset); use dplyr verbs to query the data and get results, see examples

Examples

if (FALSE) { # \dontrun{
  Sys.setenv("R_USER_DATA_DIR" = tempfile())
  taf_install("39061", "2025")

  if (requireNamespace("arrow", quietly = TRUE) &&
    requireNamespace("dplyr", quietly = TRUE)) {
    taf_dataset()

    # find top ten most frequent street name-posttype combinations
    taf_dataset() |>
      dplyr::group_by(street_name, street_posttype) |>
      dplyr::summarize(
        n_zips = dplyr::n_distinct(ZIP),
        n_ranges = dplyr::n(),
        .groups = "drop"
      ) |>
      dplyr::arrange(dplyr::desc(n_zips), dplyr::desc(n_ranges)) |>
      dplyr::collect() |>
      dplyr::slice(1:10)
  }
} # }