Last chance! 50% off unlimited learning
Sale ends in
Download a US regions cartographic boundary shapefile into R
regions(resolution = "500k", year = NULL, ...)
The resolution of the cartographic boundary file. Defaults to '500k'; options include '5m' (1:5 million) and '20m' (1:20 million).
the data year (defaults to 2018).
arguments to be passed to the underlying `load_tiger` function, which is not exported.
Options include class
, which can be set to "sp"
(the default) or "sf"
to
request sp or sf class objects, and refresh
, which specifies whether or
not to re-download shapefiles (defaults to FALSE
).
Other national cartographic boundary functions:
divisions()
,
nation()
# NOT RUN {
library(tigris)
library(leaflet)
us_regions <- regions(resolution = '20m')
leaflet(us_regions) %>%
addTiles() %>%
addPolygons()
# }
Run the code above in your browser using DataLab