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: Interactive choropleth of state coastline length
From the course: Creating Maps with R
Solution: Interactive choropleth of state coastline length
(upbeat music) - Okay, let's solve this challenge by opening the script in 0510B and let's run the code line 20 through one. So that's going to load our packages, obtain shape files for the contiguous United States, and join those together with our state coastline data set line 19, we've left joint. Then line 23 through 24, I've started off our choropleth so that creates us a map showing us the contiguous United States. Let's improve this right away by changing the weight of the lines to one, and we'll change the color to white as well. Our next step is to create a pallet for our map so let's add a couple of new lines here and let's create a pallet called pal coastline kilometer and we're going to use the function color numeric for this and the first argument will specify our pallet. Vifidis, vifidis, and our domain is going to be US coastline dollar KM of coastline. So let's run line 23 and let's add this pallet to our map…
Contents
-
-
-
-
-
-
-
The basics of using Leaflet2m 57s
-
(Locked)
Use Leaflet to visualize geo locations5m 41s
-
(Locked)
Add labels and pop-ups to Leaflet maps5m 6s
-
(Locked)
Leaflet choropleth and continuous data6m 17s
-
(Locked)
Leaflet choropleth and discontinuous data6m 3s
-
(Locked)
Set a background color with leaflet.extras1m 25s
-
(Locked)
Challenge: Add pop-up labels to a map of German cities35s
-
(Locked)
Solution: Add pop-up labels to a map of German cities6m 4s
-
(Locked)
Challenge: Interactive choropleth of state coastline length39s
-
(Locked)
Solution: Interactive choropleth of state coastline length6m 20s
-
-
-