Last active
November 4, 2016 13:52
-
-
Save rudeboybert/18c659ed74f91d6b49ec5fc6846da70f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(ggplot2) | |
library(rgdal) | |
library(leaflet) | |
# Set your working directory to where the folder that contains your shapefiles is at: | |
VT <- rgdal::readOGR("VT_shapefiles/tl_2015_50_tract.shp", layer = "tl_2015_50_tract") | |
# The variable in ALAND exists here, i.e. you don't need to join anything | |
VT@data | |
leaflet(VT) %>% | |
addTiles() %>% | |
addPolylines(color="black", weight=1) %>% | |
addPolygons( | |
stroke = FALSE, fillOpacity = 0.5, smoothFactor = 0.5, | |
color = ~colorQuantile("YlOrRd", VT$ALAND)(ALAND) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment