Skip to content

Instantly share code, notes, and snippets.

@ctesta01
Created December 14, 2021 15:14
Show Gist options
  • Select an option

  • Save ctesta01/73d0ee23e27d360288e1bb001ae13bd3 to your computer and use it in GitHub Desktop.

Select an option

Save ctesta01/73d0ee23e27d360288e1bb001ae13bd3 to your computer and use it in GitHub Desktop.
library(plotly)
library(sf)
library(dplyr)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
N <- 10
# make random data
df <- lapply(1:N, function(x) nc) %>% bind_rows %>%
bind_cols(frame = rep(c(1:N), each = nrow(nc)),
value = rnorm(n = nrow(nc)*N))
plot_ly(df,
split = ~FIPS,
frame = ~frame,
color = ~value,
showlegend = F,
alpha = 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment