From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Solution: Visualize state coastline length with choropleth
From the course: Creating Maps with R
Solution: Visualize state coastline length with choropleth
(upbeat music) - [Instructor] Okay, so let's start solving this challenge by opening the script in the 04_10b project. Going to load my packages on lines one through five. Line seven through 12, we're going to obtain shape files for the contiguous United States. Line 15 we'll read in a dataset. Lines 17 through 19, we're going to join those two data sets together. I just want to print this to the console so you can see it's an SF object. And there's a column called KM of coastline that tells us how many kilometers of coastline each state has. And notice many of the states have NA values. So I've started our data visualization off, on lines 22 through 24. But what we want to do is turn this into an actual choropleth, by varying the color of each of the regions. So I'm going to add a comma, AES, fill is equal to KM of coastline. And what ggplot2 does, is it sees our numeric column and it creates a default continuous…
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
-
-
-
-