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 here: https://www.transportation.gov/gis/national-address-database
nad_read() reads data from the NAD geodatabase by county,
downloading it first to the R user's data directory for the addr package
if not already downloaded with nad_download(), and readies it for R.
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 still determine the cache path and source query.
The NAD geodatabase has a very large size on disk (~10 GB).
Data binaries are the cached outputs of nad_read() for each
County/State and are created on first run with nad().
Download data binaries to the R_user_dir cache folder or point R
(?R_user_dir) to these files on disk to read NAD tables without
having to download the nationwide NAD geodatabase.
(Files are organized by major package version,
NAD release, state, and named by county; e.g., see
list.files(tools::R_user_dir("addr", "cache"), recursive = TRUE))
Usage
nad(
county,
state = NULL,
release = "latest",
refresh_binary = c("yes", "no", "force"),
refresh_source = c("yes", "no", "force")
)
nad_read(
county,
state = NULL,
release = "latest",
refresh_source = c("yes", "no", "force")
)
nad_download(release = "latest", 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- release
character, length 1; revision of the NAD; the default ("latest") fetches the most recent version available online; specify other versions by their .zip filename (see examples)
- refresh_binary
character, length one; choose how to refresh NAD data binaries cached on disk if not already present; "yes" will create data binary if not already present, "no" will error if data binary is not already present, "force" will create the data binary and overwrite any existing data binary
- refresh_source
character, length one; choose how to refresh NAD source geodatabase on disk if not already present; "yes" wil download the geodatabase if not already present, "no" will error if file does not already exist, "force" will download and overwrite any existing geodatabase
Details
The NAD is downloaded from each release on the transportation.gov data portal: https://data.transportation.gov/d/yw36-suxr For the original schema, see https://www.transportation.gov/sites/dot.gov/files/2023-07/NAD_Schema_202304.pdf Before downloading, please read the disclaimer here: https://www.transportation.gov/mission/open/gis/national-address-database/national-address-database-nad-disclaimer
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
# read data from NAD, caching output on first run
if (FALSE) { # \dontrun{
nad("Hamilton", "OH")
nad("39061")
} # }
# example data preloaded for Hamilton County, OH
# works without downloading NAD gdb first
nad("Hamilton", "OH", refresh_source = "no", refresh_binary = "no")
#> # A tibble: 349,407 × 7
#> nad_addr subaddress uuid date_update s2 address_type parcel_id
#> <addr> <chr> <chr> <date> <s2c> <chr> <chr>
#> 1 7610 THOMPSON Rd C… NA {68A… 2025-03-30 8840… Unknown NA
#> 2 9483 ZOLA Ct HARRI… NA {CBF… 2025-03-30 8840… Unknown NA
#> 3 208 MOHAWK St CINC… NA {B18… 2025-03-30 8841… Unknown NA
#> 4 11800 READING Rd C… NA {393… 2025-03-30 8840… Unknown NA
#> 5 12050 PRINCETON Pi… NA {478… 2025-03-30 8840… Unknown NA
#> 6 6610 PFEIFFER Rd C… NA {947… 2025-03-30 8840… Unknown NA
#> 7 6501 PFEIFFER Rd C… NA {998… 2025-03-30 8840… Unknown NA
#> 8 4244 ROUND BOTTOM … NA {5F5… 2025-03-30 8841… Unknown NA
#> 9 8210 MARKET PLACE … NA {C01… 2025-03-30 8840… Unknown NA
#> 10 8212 MARKET PLACE … NA {2A8… 2025-03-30 8840… Unknown NA
#> # ℹ 349,397 more rows
nad("39061", refresh_source = "no", refresh_binary = "no")
#> # A tibble: 349,407 × 7
#> nad_addr subaddress uuid date_update s2 address_type parcel_id
#> <addr> <chr> <chr> <date> <s2c> <chr> <chr>
#> 1 7610 THOMPSON Rd C… NA {68A… 2025-03-30 8840… Unknown NA
#> 2 9483 ZOLA Ct HARRI… NA {CBF… 2025-03-30 8840… Unknown NA
#> 3 208 MOHAWK St CINC… NA {B18… 2025-03-30 8841… Unknown NA
#> 4 11800 READING Rd C… NA {393… 2025-03-30 8840… Unknown NA
#> 5 12050 PRINCETON Pi… NA {478… 2025-03-30 8840… Unknown NA
#> 6 6610 PFEIFFER Rd C… NA {947… 2025-03-30 8840… Unknown NA
#> 7 6501 PFEIFFER Rd C… NA {998… 2025-03-30 8840… Unknown NA
#> 8 4244 ROUND BOTTOM … NA {5F5… 2025-03-30 8841… Unknown NA
#> 9 8210 MARKET PLACE … NA {C01… 2025-03-30 8840… Unknown NA
#> 10 8212 MARKET PLACE … NA {2A8… 2025-03-30 8840… Unknown NA
#> # ℹ 349,397 more rows
# some older releases can still be downloaded
if (FALSE) { # \dontrun{
nad_download(release = "NAD_r21_FGDB.zip")
} # }
# can also point to older releases if they are already downloaded
# or if data binaries are installed
if (FALSE) { # \dontrun{
nad_download(release = "NAD_r21_FGDB.zip", refresh_source = "no")
} # }