-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_maps.R
More file actions
31 lines (26 loc) · 1.02 KB
/
plot_maps.R
File metadata and controls
31 lines (26 loc) · 1.02 KB
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
library(tidyverse)
library(rgdal)
wahlkreise_map <- readOGR(dsn = "RBS_OD_Wahlkreise_AH2021", stringsAsFactors = F)
wahlkreise_bez <- broom::tidy(wahlkreise_map, region = "BEZ")
wahlkreise_bez %>%
ggplot(aes(x = long, y = lat, group = group, fill = id)) +
geom_polygon(colour = "black") +
theme_void()
wahlkreise_awk <- broom::tidy(wahlkreise_map, region = "AWK") %>%
mutate(bez = str_trunc(id, 2, "right",""))
wahlkreise_awk %>%
ggplot(aes(x = long, y = lat, group = group, fill = bez)) +
geom_polygon(colour = "black") +
theme_void()
wahlkreise_awk %>% filter(bez == "05") %>%
ggplot(aes(x = long, y = lat, group = group, fill = id)) +
geom_polygon(colour = "black") +
theme_void()
# wahllokale_map <- readOGR(dsn = "RBS_OD_Wahllokale_AH23/RBS_OD_Wahllokale_AH23.shp", stringsAsFactors = F)
# summary(wahllokale_map)
# plot(wahllokale_map)
# wahllokale_map %>%
# ggplot(aes(x = long, y = lat, group = group)) +
# geom_polygon(colour = "black", fill = NA) +
# theme_void()
# ist ein Punkt-Datensatz