Skip to content

Instantly share code, notes, and snippets.

@walkerke
Created August 16, 2018 17:56
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save walkerke/eb33dbe1a0a7658b6064716aee098df5 to your computer and use it in GitHub Desktop.
Save walkerke/eb33dbe1a0a7658b6064716aee098df5 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")
@rewerts
Copy link

rewerts commented Aug 19, 2018

when I run the drop_na i get an error I've never seen before: Error in stats::complete.cases(data[vars]) :
invalid 'type' (list) of argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment