From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Label maps with ggrepel package
From the course: Creating Maps with R
Label maps with ggrepel package
- [Instructor] The ggrepel package is an awesome extension for labeling ggplot2 charts. Unfortunately it doesn't yet work with sf objects. So if we want to label our maps, we need to do a little bit of work to convert sf objects into data frames or tibbles. To demonstrate how this works, we're going to add labels to this Geo bubble chart of the larger cities in Brazil. I'd like you to load the script in the 04_04b project, and let's start running the code. So lines 14 through one we're going to load our packages and define our data sets and then I'll make the environment smaller, so we can see our data visualization code on lines 19 through 37. So that's our geo bubble chart that we're going to add our labels too. The first thing we need to do is load the ggrepel package. So I'll scroll the top of the script once more. I'll type library ggrepel, and I'll run that code to load the package. Now I'm going to introduce you…
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
-
-
-
-