From the course: R: Interactive Visualizations with htmlwidgets
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Change map styles in Leaflet - R Tutorial
From the course: R: Interactive Visualizations with htmlwidgets
Change map styles in Leaflet
- [Instructor] When creating interactive maps, one of the things people care about most is how does the map look. Are geographic features like mountains shown? Is socio-political information like country borders included? Or do you simply want to a plain map with the outline of the land masses of Earth? Let's look at how we can customize the appearance of maps in Leaflet. In our exercise files, let's open up default-map-style.R. I'm going to decrease the size of my environment because I don't need it for this exercise. At the top of the script file, we load two libraries: first is the tidyverse library for importing and wrangling data and second is the Leaflet library which we're going to use to create our interactive map. I'll load this with Command + Enter then on Line 4, I use read underscore csv from the read.R library to import my CSV file against the variable capital underscore cities. Now, Lines 8 through 12 are where I've defined my interactive map. Let's evaluate this in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
What is the Leaflet library?6m 10s
-
(Locked)
Create interactive scattergeo maps9m 56s
-
(Locked)
Change map styles in Leaflet4m 36s
-
(Locked)
Prepare data for a choropleth plot9m 48s
-
(Locked)
Create interactive choropleth maps10m 7s
-
(Locked)
Create interactive geolines maps13m 50s
-
(Locked)
Add legends to Leaflet maps7m 52s
-
(Locked)
Extract click information from Leaflet6m 35s
-
-
-
-
-
-