Skip to content

Instantly share code, notes, and snippets.

@xvrdm
Forked from walkerke/mapdeck_housing.R
Created August 17, 2018 08:48
Show Gist options
  • Save xvrdm/d834009319be0827c0dda79024f2b43f to your computer and use it in GitHub Desktop.
Save xvrdm/d834009319be0827c0dda79024f2b43f to your computer and use it in GitHub Desktop.
library(tidycensus)
library(mapdeck)
library(tidyverse)
token <- "your mapbox token"
hv <- get_acs(geography = "tract",
variables = "B25077_001",
state = "CA",
geometry = TRUE) %>%
drop_na(estimate) %>%
mutate(elev = estimate/ 100)
mapdeck(token = token) %>%
add_polygon(data = hv,
fill_colour = "estimate",
tooltip = "estimate",
stroke_width = 0,
layer = "ca_housing",
elevation = "elev")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment