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.
Create interactive maps - R Tutorial
From the course: R: Interactive Visualizations with htmlwidgets
Create interactive maps
- [Instructor] Plotly allows us to make two types of interactive maps, scattergeo plots and choropleth. Plotly is slightly limited in the types of map that can be used to generate, as we may only use built in country and state shape files. Let's see how we can go about building these charts in our exercise files, so let's begin with, I'm going to open the scatter-geo.R file in the exercise files. Let's just minimize the environment because I don't need to see it here, and at the top of the script file, we can see that we load first the tidyverse library with command enter, and then on line two, we load the oidnCharts library, which I've run with command enter. oidnCharts prints out a message telling us that oidnCharts provides a number of templates for comparing htmlwidgets. We must separately load each htmlwidget before we use it. Let's do that on line three. Let's type library("plotly") and hit command enter. On line four through six, we're manipulating a data_scatter_geo object…
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 Plotly library?9m 50s
-
(Locked)
Make ggplot2 interactive using Plotly7m 27s
-
(Locked)
Create interactive stacked bar charts9m 3s
-
(Locked)
Interactive scatter, line, and bubble charts with Leaflet8m 15s
-
(Locked)
Create interactive maps8m 47s
-
(Locked)
Specify custom colors7m 11s
-
(Locked)
Customize tooltips4m 33s
-
(Locked)
Combine multiple charts7m 18s
-
(Locked)
Extract click information from Plotly6m 22s
-
-
-
-
-