-
Notifications
You must be signed in to change notification settings - Fork 1
/
vote-saint-malo.R
33 lines (30 loc) · 1.38 KB
/
vote-saint-malo.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
30
31
32
33
library(tidyverse)
library(rgdal)
source("/home/colin/Dropbox/R/misc/data-bzh-tools-master/main.R")
saintma <- read_csv2("https://data.stmalo-agglomeration.fr/explore/dataset/emplacement-des-bureaux-de-vote-saint-malo/download/?format=csv&timezone=Europe/Berlin&use_labels_for_header=true")
saintma <- saintma %>%
separate(`Geo Point`, into = c("long","lat"), sep = ",")
table(saintma$CANTON) %>%
sort()
roj <- readOGR(dsn=".", layer="quartiers-de-saint-malo")
wmap_df <- fortify(roj)
ggplot(wmap_df, aes(long,lat, group=group)) +
geom_polygon(fill = "antiquewhite") +
coord_map() +
geom_path(data=wmap_df, aes(long, lat, group=group), color="grey50") +
geom_point(data=saintma, aes(as.numeric(lat), as.numeric(long), group = NULL), color = databzh$colour3, size = 3) +
scale_size(range = c(1,12)) +
xlab("") +
ylab(" ") +
labs(title = "Centres de vote sur Saint Malo",
subtitle = "Données via : Open Data Saint Malo",
caption = "http://data-bzh.fr") +
theme(title=element_text(),
plot.title=element_text(margin=margin(0,0,20,0), size=18, hjust = 0.5),
axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks=element_blank(),
axis.title.x=element_blank(),
axis.title.y=element_blank(),
panel.grid.major= element_line("grey50", linetype = "dashed"),
panel.background= element_blank())