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

Create interactive maps - R Tutorial

From the course: R: Interactive Visualizations with htmlwidgets

Start my 1-month free trial

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…

Contents