From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Zoom into regions with coords_sf()
From the course: Creating Maps with R
Zoom into regions with coords_sf()
- Sometimes we want to zoom into a map to focus on specific features. For instance, in this map of hospitals in Oregon, it's clear that highest density of hospitals is in the Northwest. And specifically in Multnomah County. When we build interactive maps with packages like leaflet it's really easy for the reader to zoom into a region. But when we use ggplot2 to create static maps this process requires some thought. We could try to filter our data set to show only the border for Multnomah but that removes some important context from the map. So we need a way to zoom into the map by specifying limits for the X and Y coordinates. Let's load up the script in your 0 4 0 5 B project and start running our code line 7 through 1. We're going to load our packages. And we're also going to obtain shaped files for the counties of Oregon. Takes a couple of seconds to download these onto your machine. And then lines 9 through 12,…
Contents
-
-
-
-
-
-
Use geom_sf to visualize geo locations5m 53s
-
(Locked)
ggplot2 choropleth and continuous data6m 46s
-
(Locked)
ggplot2 choropleth and discrete data6m 14s
-
(Locked)
Label maps with ggrepel package5m 14s
-
(Locked)
Zoom into regions with coords_sf()3m 37s
-
(Locked)
Transform CRS with coord_sf()2m 25s
-
(Locked)
Challenge: Label a geobubble chart of Germany's biggest cities32s
-
(Locked)
Solution: Label a geobubble chart of Germany's biggest cities4m 45s
-
(Locked)
Challenge: Visualize state coastline length with choropleth33s
-
(Locked)
Solution: Visualize state coastline length with choropleth4m 11s
-
-
-
-