The U.S. Department of Transportation partners with address programs from state, local, and tribal governments to compile their authoritative data into a database. Find more information in the source data portal: https://data.transportation.gov/d/fc2s-wawr
nad() reads processed NAD data for one county, installing that county from
source data managed by nad_download() when needed.
Counties can be identified either by county name plus state, or by a
5-digit county FIPS identifier. County names and state abbreviations are
resolved internally and determine the processed-data path and source filter.
The revision 23 source is a roughly 7.6 GB compressed archive containing a
roughly 41 GB comma-delimited text member.
nad_catalog() reads the packaged revision 23 catalog of source-available
counties and is consulted before extracting a missing county.
Processed county Parquet files are created one county at a time with
nad_install() or on first use with nad().
The compressed national source is managed exclusively by stow() beneath
stow::stow_path(package = "addr", subdir = "nad"). Derived county Parquet
files are a separate Hive-partitioned dataset beneath
file.path(tools::R_user_dir("addr", "data"), "v2", "nad", "23"), organized
by state and county_fips. nad_manifest() inventories those county files
from v2/nad_manifest/23/counties.parquet. Set R_USER_DATA_DIR to
relocate both areas while retaining their source-versus-processed-data
separation.
Usage
nad(
county,
state = NULL,
version = 23L,
refresh_binary = c("yes", "no", "force"),
refresh_source = c("no", "yes", "force")
)
nad_install(
county,
state = NULL,
version = 23L,
overwrite = FALSE,
refresh_source = c("no", "yes", "force")
)
nad_download(version = 23L, refresh_source = c("yes", "no", "force"))Arguments
- county
character, length one; county name or 5-digit county FIPS identifier
- state
character, length one; name or abbreviation of state. Required when
countyis a county name; ignored whencountyis a 5-digit county FIPS identifier- version
integer, length one; NAD revision to use. Only revision 23 is supported.
- refresh_binary
character, length one; choose how to refresh a processed NAD county Parquet file if not already present;
"yes"creates a missing file,"no"requires it to exist, and"force"recreates it- refresh_source
character, length one; choose how to refresh the compressed national source;
"no"requires the stow-managed source to exist,"yes"downloads it if missing, and"force"redownloads it- overwrite
logical, length one; overwrite an existing processed county Parquet file?
Value
nad() returns a tibble for one county. nad_install() invisibly
returns the installed county FIPS identifier.
Details
The revision 23 comma-delimited flat source archive is downloaded from the
transportation.gov data portal:
https://data.transportation.gov/d/fc2s-wawr.
nad_download(version = 23L) installs the pinned compressed archive as a
durable managed local copy using stow::stow(). County installation streams
the nationwide text member directly from that archive, retains the requested
county, and writes a separate processed Parquet file.
The roughly 41 GB text member is never unpacked on disk.
Before downloading, review the source metadata and disclaimer in the data
portal.
Investigate individual address points in the online viewer: https://usdot.maps.arcgis.com/apps/instant/portfolio/index.html?appid=59f7e4fb71994d13b61f424e21a6cffe
The NAD does not distinguish between empty and missing address components.
When reading into R, all missing address components are replaced with an
empty string ("") except for address number (digits), street name,
and ZIP code.
Addresses with malformed ZIP codes are removed.
Examples
# explicitly download source data, then create county output on first read
if (FALSE) { # \dontrun{
# manually install the compressed revision 23 flat source archive
nad_download()
# manually build a county Parquet file
nad_install("39017")
# read files by name or fips id into R,
# nad will be downloaded and counties installed as needed
nad("Butler", "OH")
nad("39017")
} # }
# small packaged revision 23 fixture derived from Hamilton County, OH
nad_example_data()
#> # A tibble: 5,000 × 7
#> nad_addr subaddress uuid date_update s2 address_type parcel_id
#> <addr> <chr> <chr> <date> <s2_> <chr> <chr>
#> 1 3359 QUEEN CITY AV… NA {E3A… 2025-03-30 -6.7… Unknown NA
#> 2 1040 KREIS LN CINC… NA {D05… 2025-03-30 -6.7… Unknown NA
#> 3 9960 DALY RD CINCI… NA {109… 2025-03-30 -6.1… Unknown NA
#> 4 413 VOLKERT PL CIN… NA {1BB… 2025-03-30 -6.7… Unknown NA
#> 5 8519 LINDERWOOD LN… NA {F78… 2025-03-30 -6.6… Unknown NA
#> 6 6361 BEECHMONT AVE… NA {6D4… 2025-03-30 -6.6… Unknown NA
#> 7 10466 ADVENTURE LN… NA {1D1… 2025-03-30 -6.1… Unknown NA
#> 8 3156 LOOKOUT CIR C… NA {AE8… 2025-03-30 -6.6… Unknown NA
#> 9 310 WYOMING AVE CI… NA {331… 2025-03-30 -6.1… Unknown NA
#> 10 118 SPRINGFIELD PI… NA {F3E… 2025-03-30 -6.1… Unknown NA
#> # ℹ 4,990 more rows