I am trying to map California counties by using leaflet. I am not receiving any errors, but the map is not producing the correct results.
I found a .shp
file for the county lines at https://data.ca.gov/dataset/ca-geographic-boundaries. I imported the .shp
file using rgdal
, and I attempted to map the boundaries by using the addPolygons()
function.
` # Importing CA County Lines
ca_counties <- readOGR("Miller/CA_Counties/CA_Counties_TIGER2016.shp")
# Mapping County Lines
map1 <- leaflet() %>%
addTiles() %>%
addPolygons(data=ca_counties)
map1`
Instead of county lines, the program is generating a singular line that is running through my entire map. I've attached a image of the output.