03:00
Challenge 1: 5 mins
Challenge 2: 3 mins
A) location B) leisure C) osm_id
03:00
Challenge 2: 3 mins
Challenge 3: 5 mins
05:00
Challenge 3: 5 mins
levels(factor(lines_Delft$highway))
-
-motorway_Delft <- lines_Delft %>%
- filter(highway == "motorway")
-
-motorway_Delft %>%
- mutate(length = st_length(.)) %>%
- select(everything(), geometry) %>%
- summarise(total_length = sum(length))
-
-nrow(motorway_Delft)
-
-ggplot(data = motorway_Delft) +
- geom_sf(size = 1.5) +
- ggtitle("Mobility network of Delft", subtitle = "Motorways") +
- coord_sf()
levels(factor(lines_Delft$highway))
+
+motorway_Delft <- lines_Delft %>%
+ filter(highway == "motorway")
+
+motorway_Delft %>%
+ mutate(length = st_length(.)) %>%
+ select(everything(), geometry) %>%
+ summarise(total_length = sum(length))
+
+nrow(motorway_Delft)
+
+ggplot(data = motorway_Delft) +
+ geom_sf(size = 1.5) +
+ ggtitle("Mobility network of Delft", subtitle = "Motorways") +
+ coord_sf()
Challenge 4: 3 mins
03:00
Challenge 4: 3 mins
levels(factor(lines_Delft$highway))
-
-line_widths <- c(0.25, 0.75, 0.5, 1)
-
-ggplot(data = lines_Delft_selection) +
- geom_sf(aes(size = highway)) +
- scale_size_manual(values = line_widths) +
- labs(size = "Road Size") +
- ggtitle("Mobility network of Delft", subtitle = "Roads & Cycleways - Line width varies") +
- coord_sf()
levels(factor(lines_Delft$highway))
+
+line_widths <- c(0.25, 0.75, 0.5, 1)
+
+ggplot(data = lines_Delft_selection) +
+ geom_sf(aes(size = highway)) +
+ scale_size_manual(values = line_widths) +
+ labs(size = "Road Size") +
+ ggtitle("Mobility network of Delft", subtitle = "Roads & Cycleways - Line width varies") +
+ coord_sf()
Challenge 5: 5 mins
05:00
Challenge 5: 5 mins
levels(factor(lines_Delft_selection$highway))
-
-lines_Delft_bicycle <- lines_Delft %>%
- filter(highway == "cycleway")
-
-ggplot() +
- geom_sf(data = lines_Delft) +
- geom_sf(data = lines_Delft_bicycle, color = "magenta", size = 2) +
- ggtitle("Mobility network of Delft", subtitle = "Roads dedicated to bikes") +
- coord_sf()
levels(factor(lines_Delft_selection$highway))
+
+lines_Delft_bicycle <- lines_Delft %>%
+ filter(highway == "cycleway")
+
+ggplot() +
+ geom_sf(data = lines_Delft) +
+ geom_sf(data = lines_Delft_bicycle, color = "magenta", size = 2) +
+ ggtitle("Mobility network of Delft", subtitle = "Roads dedicated to bikes") +
+ coord_sf()
Challenge 6: 3 mins
03:00
Challenge 6: 3 mins
municipal_boundaries_NL <- st_read(here("episodes", "data", "nl-gemeenten.shp"))
-str(municipal_boundaries_NL)
-levels(factor(municipal_boundaries_NL$ligtInPr_1))
-
-ggplot(data = municipal_boundaries_NL) +
- geom_sf(aes(color = ligtInPr_1), size = 1) +
- ggtitle("Contiguous NL Municipal Boundaries") +
- coord_sf()
municipal_boundaries_NL <- st_read(here("episodes", "data", "nl-gemeenten.shp"))
+str(municipal_boundaries_NL)
+levels(factor(municipal_boundaries_NL$ligtInPr_1))
+
+ggplot(data = municipal_boundaries_NL) +
+ geom_sf(aes(color = ligtInPr_1), size = 1) +
+ ggtitle("Contiguous NL Municipal Boundaries") +
+ coord_sf()
Challenge 7: 5 mins
05:00
Challenge 7: 5 mins
leisure_locations_selection <- st_read(here("episodes", "data", "delft-leisure.shp")) %>%
- filter(leisure %in% c("playground", "picnic_table"))
-
-blue_orange <- c("cornflowerblue", "darkorange")
-
-p <- ggplot() +
- geom_sf(data = lines_Delft_selection, aes(color = highway)) +
- scale_color_manual(name = "Line Type", values = road_colors) +
- ggtitle("Road network and leisure")
-
-p +
- geom_sf(data = leisure_locations_selection, aes(fill = leisure), shape = 21) +
- scale_fill_manual(name = "Leisure Type", values = blue_orange)
-
-p +
- geom_sf(data = leisure_locations_selection, aes(fill = leisure, shape = leisure), size = 3) +
- scale_fill_manual(name = "Leisure Type", values = blue_orange) +
- scale_shape_manual(name = "Leisure Type", values = c(21, 22))
leisure_locations_selection <- st_read(here("episodes", "data", "delft-leisure.shp")) %>%
+ filter(leisure %in% c("playground", "picnic_table"))
+
+blue_orange <- c("cornflowerblue", "darkorange")
+
+p <- ggplot() +
+ geom_sf(data = lines_Delft_selection, aes(color = highway)) +
+ scale_color_manual(name = "Line Type", values = road_colors) +
+ ggtitle("Road network and leisure")
+
+p +
+ geom_sf(data = leisure_locations_selection, aes(fill = leisure), shape = 21) +
+ scale_fill_manual(name = "Leisure Type", values = blue_orange)
+
+p +
+ geom_sf(data = leisure_locations_selection, aes(fill = leisure, shape = leisure), size = 3) +
+ scale_fill_manual(name = "Leisure Type", values = blue_orange) +
+ scale_shape_manual(name = "Leisure Type", values = c(21, 22))
Challenge 8: 3 mins
03:00
Challenge 8: 3 mins
boundary_ZH <- municipal_boundary_NL %>%
- filter(ligtInPr_1 == "Zuid-Holland")
-
-ggplot() +
- geom_sf(data = boundary_ZH, aes(color ="color"), show.legend = "line") +
- scale_color_manual(name = "", labels = "Municipal Boundaries", values = c("color" = "gray18")) +
- geom_sf(data = boundary_Delft, aes(shape = "shape"), color = "purple", fill = "purple") +
- scale_shape_manual(name = "", labels = "Municipality of Delft", values = c("shape" = 19)) +
- ggtitle("Delft location in South Holland") +
- theme(legend.background = element_rect(color = NA)) +
- coord_sf()
boundary_ZH <- municipal_boundary_NL %>%
+ filter(ligtInPr_1 == "Zuid-Holland")
+
+ggplot() +
+ geom_sf(data = boundary_ZH, aes(color ="color"), show.legend = "line") +
+ scale_color_manual(name = "", labels = "Municipal Boundaries", values = c("color" = "gray18")) +
+ geom_sf(data = boundary_Delft, aes(shape = "shape"), color = "purple", fill = "purple") +
+ scale_shape_manual(name = "", labels = "Municipality of Delft", values = c("shape" = 19)) +
+ ggtitle("Delft location in South Holland") +
+ theme(legend.background = element_rect(color = NA)) +
+ coord_sf()