-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExample_Map.R
29 lines (26 loc) · 905 Bytes
/
Example_Map.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
### Some helpful code sourced from:
### https://rstudio-pubs-static.s3.amazonaws.com/285359_35d630ddbc554c62b9137c13f063ee0e.html
library(ggplot2)
library(ggmap)
library(maps)
library(mapdata)
library(dplyr)
(
map_data("county") %>%
subset(region == "maryland") %>%
group_by(group) %>%
mutate(y = rnorm(1)) %>%
ungroup %>%
ggplot() +
coord_fixed(1.3) +
geom_polygon(
aes(x = long, y = lat, group = group, fill = y),
color = "white") +
theme_void()+
theme(legend.position = "none")
)%>%
ggplotly(tooltip = c("subregion")) %>%
layout(xaxis = list(fixedrange = TRUE,
showgrid = FALSE),
yaxis = list(fixedrange = TRUE,
showgrid = FALSE))