Download a Zip Code Tabulation Area (ZCTA) shapefile into R
ZIP Code Tabulation Areas (ZCTAs) are generalized areal representations of United States Postal Service (USPS) ZIP Code service areas. Please see the link provided for information on how the Census Bureau creates ZCTAs, and for important information on the differences between ZCTAs and ZIP Codes.
zctas(cb = FALSE, starts_with = NULL, year = NULL, state = NULL, ...)
cb |
If cb is set to TRUE, download a generalized (1:500k) ZCTA file. Defaults to FALSE (the most detailed TIGER/Line file). A warning: the detailed TIGER/Line ZCTA file is massive (around 502MB unzipped), and the generalized version is also large (64MB zipped). Be prepared for this especially if you have a slower internet connection. |
starts_with |
Character vector specifying the beginning digits of the
ZCTAs you want to return. For example, supplying the argument
|
year |
the data year (defaults to 2019). |
state |
the state for which you are requesting data; only available for 2000 and 2010 |
... |
arguments to be passed to the underlying 'load_tiger' function, which is not exported.
Options include |
Other general area functions:
block_groups()
,
blocks()
,
counties()
,
county_subdivisions()
,
places()
,
pumas()
,
school_districts()
,
states()
,
tracts()
## Not run: # Example: get ZCTAs that intersect the Memphis, TN urbanized area library(tigris) zcta1 <- zctas(cb = TRUE, starts_with = c("37", "38", "72")) uas <- urban_areas() memphis_ua <- uas[grep("Memphis", uas$NAME10), ] mem_zcta <- zcta1[memphis_ua, ] plot(mem_zcta$geometry) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.